-
Notifications
You must be signed in to change notification settings - Fork 1
/
GeoKR_resnet50_cfg.py
101 lines (99 loc) · 3.32 KB
/
GeoKR_resnet50_cfg.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
99
100
101
'''
@Project : RepresentationLearningLand
@File : calss_resnet50_meanteacher_cfg.py
@Author : Wenyuan Li
@Date : 2020/11/18 21:25
@Desc :
'''
mode='train'
img_size=256
config=dict(
name='InterfaceRepresentation',
backbone_cfg=dict(
name='resnet50',
num_classes=None,
in_channels=3,
pretrained=True,
out_keys=None
),
head_cfg=dict(
name='ClassificationHead',
in_key=None,
feature_finetune=True, # whether ot not to finetune conv layers
in_channels=2048,
hidden_channels=None,
num_classes=8,
img_size=img_size,
),
train_cfg=dict(
batch_size=8,
device='0',
num_epoch=10,
num_workers=0,
update_step=[x for x in range(500,30801,10000)],
train_data=dict(
data_path=r'I:\experiments\representation_learning_land\dataset\GeoKR\train.txt',
label_path=r'J:\experiments\GeoCon\dataset\RSIData_WithLabels_10landcovers',
data_format='*.tif',
class_list=['Artifical_Surfaces', 'Bareland', 'Cultivated_Land', 'Foreast', 'Grassland', 'Permanent_Snow',
'Waterbodies', 'Wetland'],
img_size=img_size,
with_label=True,
with_name=False,
sample_step=-1,
transforms_cfg=dict(
RandomHorizontalFlip=dict(name='RandomHorizontalFlip'),
RandomVerticalFlip=dict(name='RandomVerticalFlip'),
Rotate=dict(name='Rotate'),
ColorJitter=dict(name='ColorJitter', brightness=0.3, contrast=(0.5, 1.5),
saturation=(0.5, 1.5),hue=(-0.3, 0.3)),
Resize=dict(name='Resize',size=(img_size,img_size)),
ToTensor=dict(name='ToTensor')
),
),
valid_data=dict(
data_path=r'I:\experiments\representation_learning_land\dataset\GeoKR\train.txt',
label_path=r'J:\experiments\GeoCon\dataset\RSIData_WithLabels_10landcovers',
data_format='*.tif',
class_list=['Artifical_Surfaces', 'Bareland', 'Cultivated_Land', 'Foreast', 'Grassland', 'Permanent_Snow',
'Waterbodies', 'Wetland'],
img_size=img_size,
with_label=True,
with_name=False,
sample_step=-1,
transforms_cfg=dict(
Resize=dict(name='Resize',size=(img_size,img_size)),
ToTensor=dict(name='ToTensor')
),
),
losses=dict(
representationLoss=dict(name='MeanTeacherLoss')
),
metric=dict(
as_binary=False,num_classes=10,as_mean=True
),
optimizer=dict(
name='Adam',
lr=0.001
),
checkpoints=dict(
checkpoints_path=r'checkpoints/pretrain/GeoKP_resnet50',
save_step=1,
with_pretrained=False,
pretrained_checkpoints_path=
r'checkpoints/pretrain/checkpoints_RSIData_resnet50',
save_last=True
),
lr_schedule=dict(
name='stepLR',
step_size=1,
gamma=0.9
),
log=dict(
log_path=r'log/pretrain/GeoKP_resnet50',
log_step=50,
with_vis=False,
vis_path=r''
),
),
)