-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathupernet_r50_512x512_ade20k_160k.py
55 lines (51 loc) · 1.98 KB
/
upernet_r50_512x512_ade20k_160k.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
_base_ = [
'../_base_/datasets/ade20k.py',
'../_base_/default_runtime.py',
]
# model settings
norm_cfg = dict(type='BN')
model = dict(
type='EncoderDecoder',
pretrained='jittorhub://resnet50_v1c-2cccc1ad.pkl',
backbone=dict(type='ResNetV1c',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
dilations=(1, 1, 1, 1),
strides=(1, 2, 2, 2),
norm_cfg=norm_cfg,
norm_eval=False,
contract_dilation=True),
decode_head=dict(type='UPerHead',
in_channels=[256, 512, 1024, 2048],
in_index=[0, 1, 2, 3],
pool_scales=(1, 2, 3, 6),
channels=512,
dropout_ratio=0.1,
num_classes=150,
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0)),
auxiliary_head=dict(type='FCNHead',
in_channels=1024,
in_index=2,
channels=256,
num_convs=1,
concat_input=False,
dropout_ratio=0.1,
num_classes=150,
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
max_iter = 160000
eval_interval = 8000
checkpoint_interval = 8000
scheduler = dict(type='PolyLR', max_steps=max_iter, power=0.9, min_lr=1e-4)