-
Notifications
You must be signed in to change notification settings - Fork 147
/
run_train_00.sh
70 lines (58 loc) · 1.4 KB
/
run_train_00.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
#!/usr/bin/env bash
DATA=cub
DATA_ROOT=data
Gallery_eq_Query=True
LOSS=Weight
CHECKPOINTS=ckps
R=.pth.tar
if_exist_mkdir ()
{
dirname=$1
if [ ! -d "$dirname" ]; then
mkdir $dirname
fi
}
if_exist_mkdir ${CHECKPOINTS}
if_exist_mkdir ${CHECKPOINTS}/${LOSS}
if_exist_mkdir ${CHECKPOINTS}/${LOSS}/${DATA}
if_exist_mkdir result
if_exist_mkdir result/${LOSS}
if_exist_mkdir result/${LOSS}/${DATA}
NET=BN-Inception
DIM=512
ALPHA=40
LR=1e-5
BatchSize=80
RATIO=0.16
SAVE_DIR=${CHECKPOINTS}/${LOSS}/${DATA}/${NET}-DIM-${DIM}-lr${LR}-ratio-${RATIO}-BatchSize-${BatchSize}
if_exist_mkdir ${SAVE_DIR}
# if [ ! -n "$1" ] ;then
echo "Begin Training!"
CUDA_VISIBLE_DEVICES=0 python train.py --net ${NET} \
--data $DATA \
--data_root ${DATA_ROOT} \
--init random \
--lr $LR \
--dim $DIM \
--alpha $ALPHA \
--num_instances 5 \
--batch_size ${BatchSize} \
--epoch 600 \
--loss $LOSS \
--width 227 \
--save_dir ${SAVE_DIR} \
--save_step 50 \
--ratio ${RATIO}
echo "Begin Testing!"
Model_LIST=`seq 50 50 600`
for i in $Model_LIST; do
CUDA_VISIBLE_DEVICES=0 python test.py --net ${NET} \
--data $DATA \
--data_root ${DATA_ROOT} \
--batch_size 100 \
-g_eq_q ${Gallery_eq_Query} \
--width 227 \
-r ${SAVE_DIR}/ckp_ep$i$R \
--pool_feature ${POOL_FEATURE:-'False'} \
| tee -a result/$LOSS/$DATA/${NET}-DIM-$DIM-Batchsize-${BatchSize}-ratio-${RATIO}-lr-$LR${POOL_FEATURE:+'-pool_feature'}.txt
done