-
Notifications
You must be signed in to change notification settings - Fork 117
/
gmstereo_scale2_regrefine3_train.sh
executable file
·251 lines (214 loc) · 6.79 KB
/
gmstereo_scale2_regrefine3_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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#!/usr/bin/env bash
# GMFlow with hierarchical matching refinement (1/8 + 1/4 features)
# with additional 3 local regression refinements
# number of gpus for training, please set according to your hardware
# trained on 8x 40GB A100 gpus
NUM_GPUS=8
# sceneflow
# resume gmstereo scale2 model, which is trained from flow things model
CHECKPOINT_DIR=checkpoints_stereo/sceneflow-gmstereo-scale2-regrefine3-resumeflowthings && \
mkdir -p ${CHECKPOINT_DIR} && \
python -m torch.distributed.launch --nproc_per_node=${NUM_GPUS} --master_port=9989 main_stereo.py \
--launcher pytorch \
--checkpoint_dir ${CHECKPOINT_DIR} \
--resume pretrained/gmstereo-scale2-resumeflowthings-sceneflow-48020649.pth \
--no_resume_optimizer \
--stage sceneflow \
--lr 4e-4 \
--batch_size 16 \
--val_dataset things kitti15 \
--img_height 384 \
--img_width 768 \
--padding_factor 32 \
--upsample_factor 4 \
--num_scales 2 \
--attn_type self_swin2d_cross_swin1d \
--attn_splits_list 2 8 \
--corr_radius_list -1 4 \
--prop_radius_list -1 1 \
--reg_refine \
--num_reg_refine 3 \
--summary_freq 100 \
--val_freq 10000 \
--save_ckpt_freq 1000 \
--save_latest_ckpt_freq 1000 \
--num_steps 100000 \
2>&1 | tee -a ${CHECKPOINT_DIR}/train.log
# vkitti2
CHECKPOINT_DIR=checkpoints_stereo/vkitti2-gmstereo-scale2-regrefine3-resumeflowthings && \
mkdir -p ${CHECKPOINT_DIR} && \
python -m torch.distributed.launch --nproc_per_node=${NUM_GPUS} --master_port=9989 main_stereo.py \
--launcher pytorch \
--checkpoint_dir ${CHECKPOINT_DIR} \
--resume checkpoints_stereo/sceneflow-gmstereo-scale2-regrefine3-resumeflowthings/step_100000.pth \
--no_resume_optimizer \
--stage vkitti2 \
--val_dataset kitti15 \
--lr 4e-4 \
--batch_size 16 \
--img_height 320 \
--img_width 832 \
--padding_factor 32 \
--upsample_factor 4 \
--num_scales 2 \
--attn_type self_swin2d_cross_swin1d \
--attn_splits_list 2 8 \
--corr_radius_list -1 4 \
--prop_radius_list -1 1 \
--reg_refine \
--num_reg_refine 3 \
--summary_freq 100 \
--val_freq 5000 \
--save_ckpt_freq 1000 \
--save_latest_ckpt_freq 1000 \
--num_steps 30000 \
2>&1 | tee -a ${CHECKPOINT_DIR}/train.log
# kitti, this is our final model for kitti submission
CHECKPOINT_DIR=checkpoints_stereo/kitti-gmstereo-scale2-regrefine3-resumeflowthings && \
mkdir -p ${CHECKPOINT_DIR} && \
python -m torch.distributed.launch --nproc_per_node=${NUM_GPUS} --master_port=9989 main_stereo.py \
--launcher pytorch \
--checkpoint_dir ${CHECKPOINT_DIR} \
--resume checkpoints_stereo/vkitti2-gmstereo-scale2-regrefine3-resumeflowthings/step_030000.pth \
--no_resume_optimizer \
--stage kitti15mix \
--val_dataset kitti15 \
--lr 4e-4 \
--batch_size 16 \
--img_height 352 \
--img_width 1216 \
--padding_factor 32 \
--upsample_factor 4 \
--num_scales 2 \
--attn_type self_swin2d_cross_swin1d \
--attn_splits_list 2 8 \
--corr_radius_list -1 4 \
--prop_radius_list -1 1 \
--reg_refine \
--num_reg_refine 3 \
--summary_freq 100 \
--val_freq 2000 \
--save_ckpt_freq 2000 \
--save_latest_ckpt_freq 1000 \
--num_steps 10000 \
2>&1 | tee -a ${CHECKPOINT_DIR}/train.log
# middlebury, train on 480x640 first
CHECKPOINT_DIR=checkpoints_stereo/middlebury-gmstereo-scale2-regrefine3-resumeflowthings && \
mkdir -p ${CHECKPOINT_DIR} && \
python -m torch.distributed.launch --nproc_per_node=${NUM_GPUS} --master_port=9989 main_stereo.py \
--launcher pytorch \
--checkpoint_dir ${CHECKPOINT_DIR} \
--resume checkpoints_stereo/sceneflow-gmstereo-scale2-regrefine3-resumeflowthings/step_100000.pth \
--no_resume_optimizer \
--stage middlebury \
--val_dataset middlebury \
--inference_size 768 1024 \
--lr 4e-4 \
--batch_size 16 \
--img_height 480 \
--img_width 640 \
--padding_factor 32 \
--upsample_factor 4 \
--num_scales 2 \
--attn_type self_swin2d_cross_swin1d \
--attn_splits_list 2 8 \
--corr_radius_list -1 4 \
--prop_radius_list -1 1 \
--reg_refine \
--num_reg_refine 3 \
--summary_freq 100 \
--val_freq 10000 \
--save_ckpt_freq 10000 \
--save_latest_ckpt_freq 1000 \
--num_steps 100000 \
2>&1 | tee -a ${CHECKPOINT_DIR}/train.log
# middlebury, finetune on 768x1024 resolution, max disparity range 600 in loss
# this is our final model for middlebury submission
CHECKPOINT_DIR=checkpoints_stereo/middlebury-gmstereo-scale2-regrefine3-resumeflowthings-fthighres && \
mkdir -p ${CHECKPOINT_DIR} && \
python -m torch.distributed.launch --nproc_per_node=${NUM_GPUS} --master_port=9989 main_stereo.py \
--launcher pytorch \
--checkpoint_dir ${CHECKPOINT_DIR} \
--resume checkpoints_stereo/middlebury-gmstereo-scale2-regrefine3-resumeflowthings/step_100000.pth \
--no_resume_optimizer \
--max_disp 600 \
--stage middlebury_ft \
--val_dataset middlebury \
--inference_size 1536 2048 \
--lr 4e-4 \
--batch_size 8 \
--img_height 768 \
--img_width 1024 \
--padding_factor 32 \
--upsample_factor 4 \
--num_scales 2 \
--attn_type self_swin2d_cross_swin1d \
--attn_splits_list 2 8 \
--corr_radius_list -1 4 \
--prop_radius_list -1 1 \
--reg_refine \
--num_reg_refine 3 \
--summary_freq 100 \
--val_freq 5000 \
--save_ckpt_freq 10000 \
--save_latest_ckpt_freq 1000 \
--num_steps 50000 \
2>&1 | tee -a ${CHECKPOINT_DIR}/train.log
# eth3d
CHECKPOINT_DIR=checkpoints_stereo/eth3d-gmstereo-scale2-regrefine3-resumeflowthings && \
mkdir -p ${CHECKPOINT_DIR} && \
python -m torch.distributed.launch --nproc_per_node=${NUM_GPUS} --master_port=9989 main_stereo.py \
--launcher pytorch \
--checkpoint_dir ${CHECKPOINT_DIR} \
--resume checkpoints_stereo/sceneflow-gmstereo-scale2-regrefine3-resumeflowthings/step_100000.pth \
--no_resume_optimizer \
--stage eth3d \
--val_dataset eth3d \
--lr 4e-4 \
--batch_size 24 \
--img_height 416 \
--img_width 640 \
--padding_factor 32 \
--upsample_factor 4 \
--num_scales 2 \
--attn_type self_swin2d_cross_swin1d \
--attn_splits_list 2 8 \
--corr_radius_list -1 4 \
--prop_radius_list -1 1 \
--reg_refine \
--num_reg_refine 3 \
--summary_freq 100 \
--val_freq 10000 \
--save_ckpt_freq 10000 \
--save_latest_ckpt_freq 1000 \
--num_steps 100000 \
2>&1 | tee -a ${CHECKPOINT_DIR}/train.log
# eth3d, finetune, this is our final model for eth3d submission
CHECKPOINT_DIR=checkpoints_stereo/eth3d-gmstereo-scale2-regrefine3-resumeflowthings-ft && \
mkdir -p ${CHECKPOINT_DIR} && \
python -m torch.distributed.launch --nproc_per_node=${NUM_GPUS} --master_port=9989 main_stereo.py \
--launcher pytorch \
--checkpoint_dir ${CHECKPOINT_DIR} \
--resume checkpoints_stereo/eth3d-gmstereo-scale2-regrefine3-resumeflowthings/step_100000.pth \
--no_resume_optimizer \
--stage eth3d_ft \
--val_dataset eth3d \
--lr 4e-4 \
--batch_size 24 \
--img_height 416 \
--img_width 640 \
--padding_factor 32 \
--upsample_factor 4 \
--num_scales 2 \
--attn_type self_swin2d_cross_swin1d \
--attn_splits_list 2 8 \
--corr_radius_list -1 4 \
--prop_radius_list -1 1 \
--reg_refine \
--num_reg_refine 3 \
--summary_freq 100 \
--val_freq 3000 \
--save_ckpt_freq 3000 \
--save_latest_ckpt_freq 1000 \
--num_steps 30000 \
2>&1 | tee -a ${CHECKPOINT_DIR}/train.log