-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtrain.sh
executable file
·59 lines (51 loc) · 1 KB
/
train.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
get_abs_filename() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
helpFunction()
{
echo "TODO"
exit 1
}
while getopts "d:f:a:m:l:c:p: " opt
do
case "$opt" in
d ) d="$OPTARG" ;;
f ) f="$OPTARG" ;;
a ) a="$OPTARG" ;;
m ) m="$OPTARG" ;;
l ) l="$OPTARG" ;;
c ) c="$OPTARG" ;;
p ) p="$OPTARG" ;;
? ) helpFunction ;;
esac
done
if [ -z "$a" ] || [ -z "$d" ] || [ -z "$m" ] || [ -z "$l" ]
then
echo "Some or all of the parameters are empty";
helpFunction
fi
d=$(get_abs_filename "$d")
a=$(get_abs_filename "$a")
l=$(get_abs_filename "$l")
if [ -z "$p" ]
then
p=""
else
p=$(get_abs_filename "$p")
fi
if [ -z "$f" ]
then
f="$d"
else
f=$(get_abs_filename "$f")
fi
export CUDA_VISIBLE_DEVICES="$c"
cd ./train/tasks/semantic
./train.py -d "$d" \
-f "$f" \
-ac "$a" \
-m "$m" \
-l "$l" \
-p "$p"
# ./train.sh -d /Dataset/ -f cfgs/ -a cfgs/ddrnet23_slim.yml -m ddrnet -l ./logs/ -c 0