-
Notifications
You must be signed in to change notification settings - Fork 10
/
eval_imagenet_quan.sh
64 lines (56 loc) · 1.5 KB
/
eval_imagenet_quan.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
#!/usr/bin/env sh
############### Host ##############################
HOST=$(hostname)
echo "Current host is: $HOST"
# Automatic check the host and configuration
case $HOST in
"alpha")
PYTHON="/home/elliot/anaconda3/envs/pytorch041/bin/python" # python environment path
TENSORBOARD='/home/elliot/anaconda3/envs/pytorch041/bin/tensorboard' # tensorboard environment path
data_path='/home/elliot/data/imagenet' # dataset path
;;
esac
DATE=`date +%Y-%m-%d`
if [ ! -d "$DIRECTORY" ]; then
mkdir ./save/${DATE}/
fi
############### Configurations ########################
enable_tb_display=false # enable tensorboard display
model=mobilenet_v2_quan
dataset=imagenet
test_batch_size=256
save_path=./save/${DATE}/${dataset}_${model}_eval/
tb_path=${save_path}/tb_log #tensorboard log path
############### Neural network ############################
{
$PYTHON main.py --dataset ${dataset} \
--data_path ${data_path} \
--arch ${model} --save_path ${save_path} \
--test_batch_size ${test_batch_size} \
--workers 8 --ngpu 1 --gpu_id 1 \
--reset_weight \
--evaluate
} &
############## Tensorboard logging ##########################
{
if [ "$enable_tb_display" = true ]; then
sleep 30
wait
$TENSORBOARD --logdir $tb_path --port=6006
fi
} &
{
if [ "$enable_tb_display" = true ]; then
sleep 45
wait
case $HOST in
"Hydrogen")
firefox http://0.0.0.0:6006/
;;
"alpha")
google-chrome http://0.0.0.0:6006/
;;
esac
fi
} &
wait