-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathupernet_convnext_base_512x512_ade20k_160k.py
65 lines (61 loc) · 2.33 KB
/
upernet_convnext_base_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
56
57
58
59
60
61
62
63
64
65
_base_ = [
'../_base_/datasets/ade20k.py',
'../_base_/default_runtime.py',
]
# model settings
model = dict(
type='EncoderDecoder',
pretrained=
'jittorhub://convnext-base_3rdparty_32xb128-noema_in1k_20220301-2a0ee547.pkl',
backbone=dict(type='ConvNeXt',
arch='base',
out_indices=[0, 1, 2, 3],
drop_path_rate=0.4,
layer_scale_init_value=1.0,
gap_before_final_norm=False),
decode_head=dict(type='UPerHead',
in_channels=[128, 256, 512, 1024],
in_index=[0, 1, 2, 3],
pool_scales=(1, 2, 3, 6),
channels=512,
dropout_ratio=0.1,
num_classes=150,
align_corners=False,
loss_decode=dict(type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0)),
auxiliary_head=dict(type='FCNHead',
in_channels=512,
in_index=2,
channels=256,
num_convs=1,
concat_input=False,
dropout_ratio=0.1,
num_classes=150,
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='slide', crop_size=(512, 512), stride=(341, 341)))
parameter_groups_generator = dict(type="LRDecayParameterGroupsGenerator",
paramwise_cfg={
'decay_rate': 0.9,
'decay_type': 'stage_wise',
'num_layers': 12
})
optimizer = dict(
type='CustomAdamW',
lr=0.0001,
betas=(0.9, 0.999),
weight_decay=0.05,
)
max_iter = 160000
scheduler = dict(type='PolyLR',
warmup='linear',
warmup_iters=1500,
warmup_ratio=1e-6,
max_steps=max_iter,
power=1.0,
min_lr=0)