forked from zhyever/Monocular-Depth-Estimation-Toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
newcrfs_swinl_22k_w7_nyu.py
75 lines (72 loc) · 2.06 KB
/
newcrfs_swinl_22k_w7_nyu.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
_base_ = [
'../_base_/models/newcrfs.py', '../_base_/datasets/nyu.py',
'../_base_/default_runtime.py'
]
model = dict(
pretrained='https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window7_224_22k.pth', # noqa
backbone=dict(
embed_dims=192,
depths=[2, 2, 18, 2],
num_heads=[6, 12, 24, 48],
window_size=7),
neck=dict(
type='PSPNeck',
in_channels=[192, 384, 768, 1536],
channels=512),
decode_head=dict(
type='NewCRFHead',
in_channels=[192, 384, 768, 1536],
window_size=7,
crf_dims=[128, 256, 512, 1024],
v_dims=[64, 128, 256, 512],
channels=128,
min_depth=1e-3,
max_depth=10,
))
# batch size
data = dict(
samples_per_gpu=2,
workers_per_gpu=2,
)
# schedules
# optimizer
max_lr=1e-4
optimizer = dict(
type='AdamW',
lr=max_lr,
betas=(0.9, 0.999),
weight_decay=0.01,
paramwise_cfg=dict(
custom_keys={
'absolute_pos_embed': dict(decay_mult=0.),
'relative_position_bias_table': dict(decay_mult=0.),
'norm': dict(decay_mult=0.),
}))
# learning policy
lr_config = dict(
policy='CosineAnnealing',
warmup='linear',
warmup_iters=1600 * 8,
warmup_ratio=1.0 / 1000,
min_lr_ratio=1e-8,
by_epoch=False) # test add by_epoch false
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=1600 * 24)
checkpoint_config = dict(by_epoch=False, max_keep_ckpts=2, interval=1600)
evaluation = dict(by_epoch=False,
start=0,
interval=800,
pre_eval=True,
rule='less',
save_best='abs_rel',
greater_keys=("a1", "a2", "a3"),
less_keys=("abs_rel", "rmse"))
# iter runtime
log_config = dict(
_delete_=True,
interval=50,
hooks=[
dict(type='TextLoggerHook', by_epoch=False),
dict(type='TensorboardLoggerHook')
])