-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtrain.sh
executable file
·51 lines (36 loc) · 1.74 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
if [ ! -d "maskrcnn_benchmark/datasets/PRW-v16.04.20" ]; then
ln -s /home/zyj/Dataset/PRW-v16.04.20 maskrcnn_benchmark/datasets/PRW-v16.04.20
fi
export NGPUS=2
if [ ! -d "models" ]; then
mkdir models
fi
#mkdir models/prw_oim
# OIM
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=$NGPUS tools/train_net.py --config-file "configs/reid/prw_R_50_C4.yaml" SOLVER.IMS_PER_BATCH 4 TEST.IMS_PER_BATCH 16 OUTPUT_DIR "models/prw_oim"
echo "----------------------------------------------------"
echo "************Training the part extractor*************"
echo "----------------------------------------------------"
if [ ! -d "models/prw_part" ]; then
mkdir models/prw_part
fi
cp models/prw_oim/last_checkpoint models/prw_part/
cp models/prw_oim/model_final.pth models/prw_part/
echo "models/prw_part/model_final.pth" > models/prw_part/last_checkpoint
rm -rf build/
python setup.py build develop
# RSFE
CUDA_VISIBLE_DEVICES=0 python tools/train_net.py --config-file "configs/reid/prw_R_50_C4_part.yaml" SOLVER.IMS_PER_BATCH 4 TEST.IMS_PER_BATCH 8 OUTPUT_DIR "models/prw_part"
echo "----------------------------------------------------"
echo "************Training the part estimator*************"
echo "----------------------------------------------------"
if [ ! -d "models/prw_padreg" ]; then
mkdir models/prw_padreg
fi
cp models/prw_part/last_checkpoint models/prw_padreg/
cp models/prw_part/model_final.pth models/prw_padreg/
echo "models/prw_padreg/model_final.pth" > models/prw_padreg/last_checkpoint
rm -rf build/
python setup.py build develop
# BBA
CUDA_VISIBLE_DEVICES=0 python tools/train_net.py --config-file "configs/reid/prw_R_50_C4_partdone_padreg.yaml" SOLVER.IMS_PER_BATCH 4 TEST.IMS_PER_BATCH 8 OUTPUT_DIR "models/prw_padreg"