miqa
xiaoqi-wang commited on
Commit
ddfccee
·
verified ·
1 Parent(s): 18b25d1

Upload models/model_configs/fcn_sere-small_finetuned_fp16_8x32_224x224_3600_imagenets919.py with huggingface_hub

Browse files
models/model_configs/fcn_sere-small_finetuned_fp16_8x32_224x224_3600_imagenets919.py ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # _base_ = [
2
+ # '../_base_/models/fcn_r50-d8.py', '../_base_/datasets/imagenets.py',
3
+ # '../_base_/default_runtime.py', '../_base_/schedules/schedule_20k.py'
4
+ # ]
5
+
6
+
7
+
8
+ model = dict(
9
+ type='EncoderDecoder', # Add this line to specify the model type
10
+ pretrained='models/checkpoints/sere_finetuned_vit_small_ep100.pth',
11
+ backbone=dict(
12
+ type='VisionTransformer',
13
+ img_size=(224, 224),
14
+ patch_size=16,
15
+ in_channels=3,
16
+ embed_dims=384,
17
+ num_layers=12,
18
+ num_heads=6,
19
+ mlp_ratio=4,
20
+ out_indices=-1, #(2, 5, 8, 11)
21
+ qkv_bias=True,
22
+ drop_rate=0.0,
23
+ attn_drop_rate=0.0,
24
+ drop_path_rate=0.1,
25
+ with_cls_token=True,
26
+ norm_cfg=dict(type='LN', eps=1e-6),
27
+ act_cfg=dict(type='GELU'),
28
+ norm_eval=False,
29
+ final_norm=True,
30
+ interpolate_mode='bicubic'),
31
+ decode_head=dict(
32
+ type='FCNHead', # Add this line to specify the decode_head type
33
+ in_channels=384,
34
+ channels=384,
35
+ num_convs=0,
36
+ dropout_ratio=0.0,
37
+ num_classes=920,
38
+ ignore_index=1000,
39
+ # downsample_label_ratio=8,
40
+ init_cfg=dict(
41
+ type='TruncNormal', std=2e-5, override=dict(name='conv_seg'))),
42
+ auxiliary_head=None)
43
+
44
+ # model = dict(
45
+ # pretrained='../checkpoints/sere_finetuned_vit_small_ep100.pth',
46
+ # backbone=dict(
47
+ # # _delete_=True,
48
+ # type='VisionTransformer',
49
+ # img_size=(224, 224),
50
+ # patch_size=16,
51
+ # in_channels=3,
52
+ # embed_dims=384,
53
+ # num_layers=12,
54
+ # num_heads=6,
55
+ # mlp_ratio=4,
56
+ # out_indices=(2, 5, 8, 11),
57
+ # qkv_bias=True,
58
+ # drop_rate=0.0,
59
+ # attn_drop_rate=0.0,
60
+ # drop_path_rate=0.1,
61
+ # with_cls_token=True,
62
+ # norm_cfg=dict(type='LN', eps=1e-6),
63
+ # act_cfg=dict(type='GELU'),
64
+ # norm_eval=False,
65
+ # final_norm=True,
66
+ # interpolate_mode='bicubic'),
67
+ # decode_head=dict(
68
+ # in_channels=384,
69
+ # channels=384,
70
+ # num_convs=0,
71
+ # dropout_ratio=0.0,
72
+ # num_classes=920,
73
+ # ignore_index=1000,
74
+ # downsample_label_ratio=8,
75
+ # init_cfg=dict(
76
+ # type='TruncNormal', std=2e-5, override=dict(name='conv_seg'))),
77
+ # auxiliary_head=None)
78
+
79
+ optimizer = dict(
80
+ _delete_=True,
81
+ constructor='LearningRateDecayOptimizerConstructor',
82
+ type='AdamW',
83
+ lr=5e-4,
84
+ betas=(0.9, 0.999),
85
+ weight_decay=0.05,
86
+ paramwise_cfg=dict(
87
+ num_layers=12, decay_rate=0.50, decay_type='layer_wise'))
88
+
89
+ lr_config = dict(
90
+ _delete_=True,
91
+ policy='CosineAnnealing',
92
+ warmup='linear',
93
+ warmup_iters=180,
94
+ warmup_ratio=1e-6,
95
+ min_lr=1e-6,
96
+ by_epoch=False)
97
+
98
+ # mixed precision
99
+ fp16 = dict(loss_scale='dynamic')
100
+
101
+ # By default, models are trained on 8 GPUs with 32 images per GPU
102
+ data = dict(samples_per_gpu=32)
103
+
104
+ # runtime settings
105
+ runner = dict(type='IterBasedRunner', max_iters=3600)
106
+ checkpoint_config = dict(by_epoch=False, interval=3600)
107
+ evaluation = dict(interval=360, metric='mIoU', pre_eval=True)