-
Notifications
You must be signed in to change notification settings - Fork 8
/
cfg_kitti_baseline_odometry_boundary_ce_iou_1024_20.py
executable file
·98 lines (94 loc) · 3.2 KB
/
cfg_kitti_baseline_odometry_boundary_ce_iou_1024_20.py
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
DEPTH_LAYERS = 18#resnet50
POSE_LAYERS = 18#resnet18
FRAME_IDS = [0, -1, 1]#0 refers to current frame, -1 and 1 refer to temperally adjacent frames, 's' refers to stereo adjacent frame.
IMGS_PER_GPU = 3 #the number of images fed to each GPU
HEIGHT = 1024#192#input image height
WIDTH = 1024#640#input image width
data = dict(
name = 'kitti_odom',#dataset name
split = 'odometry',#training split name
height = HEIGHT,
width = WIDTH,
frame_ids = FRAME_IDS,
in_path = '/raid/datasets/kitti_data/odometry/dataset/sequences',#path to raw data
gt_depth_path = '/CV/users/zhaohaimei3/gt_depths.npz',#path to gt data
png = True,#image format
stereo_scale = True if 's' in FRAME_IDS else False,
type = "static",
)
model = dict(
name = 'Baseline',# select a model by name
depth_num_layers = DEPTH_LAYERS,
pose_num_layers = POSE_LAYERS,
frame_ids = FRAME_IDS,
imgs_per_gpu = IMGS_PER_GPU,
height = HEIGHT,
width = WIDTH,
scales = [0, 1, 2, 3],# output different scales of depth maps
min_depth = 0.1, # minimum of predicted depth value
max_depth = 100.0, # maximum of predicted depth value
depth_pretrained_path = '/CV/users/zhaohaimei3/checkpoints/resnet{}.pth'.format(DEPTH_LAYERS),# pretrained weights for resnet
pose_pretrained_path = '/CV/users/zhaohaimei3/checkpoints/resnet{}.pth'.format(POSE_LAYERS),# pretrained weights for resnet
extractor_pretrained_path = '/media/sconly/harddisk/weight/autoencoder.pth',# pretrained weights for autoencoder
automask = False if 's' in FRAME_IDS else True,
disp_norm = False if 's' in FRAME_IDS else True,
perception_weight = 1e-3,
smoothness_weight = 1e-3,
scale_weight = 0.1,
use_future_frame = False,
seg_class = "car",
dynamic_weight = 15.,
static_weight = 5.,
occ_map_size = 256,
num_class = 2,
loss_type='iou',
loss_weight = 20,
loss2_type='boundary',
loss2_weight = 20,
type = "static",
loss_sum = 3,
split = 'odometry',
)
# seg_class = "car"
# dynamic_weight = 15.
# static_weight = 5.
# occ_map_size = 256
# num_class = 2
# resume_from = '/node01_data5/monodepth2-test/model/ms/ms.pth'#directly start training from provide weights
resume_from=None#'/CV/zhaohaimei3/DepthLayout_kitti_odometry_loss_transformerright_object_focalloss/log/object_iouloss_mul20/latest.pth'
finetune = None
total_epochs = 180
imgs_per_gpu = IMGS_PER_GPU
learning_rate = 1e-4
workers_per_gpu = 24
validate = True
optimizer = dict(type='Adam', lr=learning_rate, weight_decay=0)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# lr_config = dict(
# policy='step',
# warmup='linear',
# warmup_iters=500,
# warmup_ratio=1.0 / 3,
# step=[20,30],
# gamma=0.5,
# )
lr_config = dict(
policy='step',
warmup=None,
step=[50]
)
#lr_config = dict(
# policy='step',
# warmup='linear',
# warmup_iters=500,
# warmup_ratio=1.0 / 3,
# step=[20,30],
# gamma=0.5,
#)
checkpoint_config = dict(interval=1)
log_config = dict(interval=50,
hooks=[dict(type='TextLoggerHook'),])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None#'/public/data1/users/zhaohaimei3/TransDepth/log/TransDepth_4gpus/epoch_17.pth'
workflow = [('train', 1)]