-
Notifications
You must be signed in to change notification settings - Fork 0
/
task-train-multi
executable file
·98 lines (89 loc) · 1.56 KB
/
task-train-multi
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
usage() {
echo "usage: task-train-multi [options] multi.yaml modeldir"
echo
echo "arguments:"
echo
echo " multi.yaml : multiple models configuration"
echo " modeldir : model storage directory prefix"
echo
echo "general options:"
echo
echo " --tensorboard : launch tensorboard while training"
echo " --always : always run training even if model exists"
echo " --fresh : always start from empty model"
echo
echo "training options:"
echo
echo " --device DEV : tensorflow device"
echo " --ram : load dataset in ram"
echo " --verbose : output detailed summaries"
}
CONFIGURATION=
MODEL=
TENSORBOARD=
ALWAYS=
FRESH=
if [ -f "/proc/driver/nvidia/version" ]
then
DEVICE="/gpu:0"
else
DEVICE="/cpu:0"
fi
RAM=
VERBOSE=
while [ $# -ge 1 ]
do
case "$1" in
--tensorboard)
TENSORBOARD=$1
shift
;;
--always)
ALWAYS=$1
shift
;;
--fresh)
FRESH=$1
shift
;;
--device)
DEVICE=$2
shift 2
;;
--ram)
RAM=$1
shift
;;
--verbose)
VERBOSE=$1
shift
;;
*)
CONFIGURATION=$1
shift
if [ $# -ge 1 ]
then
MODEL=$1
shift
else
usage
exit 1
fi
;;
esac
done
if [ $# -gt 0 -o "x$CONFIGURATION" = "x" -o ! -f "$CONFIGURATION" -o "x$MODEL" = "x" ]
then
usage
exit 1
fi
python3 src/run.py trainmulti \
$TENSORBOARD \
$ALWAYS \
$FRESH \
--device $DEVICE \
$RAM \
$VERBOSE \
$CONFIGURATION \
$MODEL