forked from XiaotaoChen/model-quantization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
train.sh
73 lines (58 loc) · 1.13 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
60
61
62
63
64
65
66
67
68
69
70
71
if [ -e .env ]; then
source .env
if [ "$3" == "load_data" ]; then
copy_imagenet_to_ddr
fi
fi
if [ "$FASTDIR" == "" ]; then
FASTDIR=/workspace
fi
if [ -d $FASTDIR/git/ldn-quantization ]; then
cd $FASTDIR/git/ldn-quantization
elif [ -d /workspace/git/ldn-quantization ]; then
cd /workspace/git/ldn-quantization
fi
script=main.py
train_batch=20
val_batch=20
dataset='imagenet'
root=$FASTDIR/data/imagenet
case='fake'
keybase=''
keyword=','
model='unknow'
base=1
epochs=0
options=''
pretrain='none'
config=config.bin
if [ "$1" != "" ]; then config=$1; fi
if [ -e $config ];
then
echo "Loading config from $config"
source $config
fi
if [ "$DELAY" != "" ]; then
delay=$DELAY
else
delay=0
fi
if [ "$2" != "" ]; then script=$2; fi
nvidia-smi
python $script --dataset $dataset --root $root \
--model $model --base $base \
--epochs $epochs -b $train_batch -v $val_batch \
--case $case --keyword $keyword \
--delay $delay \
$options
result=$?
echo "python result $result"
if [ "$result" -ne "0" ];
then
echo $PATH
echo $LD_LIBRARY_PATH
which python
python -V
fi
cd -
#notify-send "cmd finished in $0" "`date`"