-
Notifications
You must be signed in to change notification settings - Fork 24
/
config.py
226 lines (201 loc) · 7.29 KB
/
config.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
configurations = {
# same configuration as original work
# https://github.com/shelhamer/fcn.berkeleyvision.org
0: dict(
max_iteration=100000,
lr=1.0e-10,
momentum=0.99,
weight_decay=0.0005,
interval_validate=4000,
),
# python train_*.py -g 0 -c 1
1: dict(
max_iteration=100,
lr=0.01, # changed learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=10,
optim='Adam',
batch_size=100,
),
2: dict(
max_iteration=8670, # num_iter_per_epoch = ceil(num_images/batch_size)
lr=0.01, # high learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=10,
optim='Adam',
batch_size=250,
),
3: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=8670, # 10 epochs on subset of images
lr=0.001, # lowered learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=10,
optim='Adam',
batch_size=250,
),
# ---------------------------------------------------------------------------------
# ResNet-50 on UMDFaces: stage 1
4: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=42180, # 30 epochs on full dataset (about 10 hours)
lr=0.001, # learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=50,
optim='Adam',
batch_size=250, # DataParallel over 5 gpus
),
# ResNet-50 on UMDFaces: stage 2
5: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=42180, # 30 epochs on full dataset
lr=0.0001, # lowered learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=50,
optim='Adam',
batch_size=250,
),
# ResNet-50 on UMDFaces: stage 3
6: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=42180, # 30 epochs on full dataset
lr=0.00001, # lowered learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=50,
optim='Adam',
batch_size=250,
),
# ---------------------------------------------------------------------------------
# ResNet-101 on VGGFace2: stage 1
7: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 30 epochs on full dataset
lr=0.001, # learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=500,
optim='Adam',
batch_size=350, # DataParallel over 7 gpus
),
# python vgg-face-2/train_resnet_vggface.py -c 8 -m PATH-TO-CFG-7-SAVED-MODEL
8: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 30 epochs on full dataset
lr=0.0001, # lowered learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=500,
optim='Adam',
batch_size=350, # DataParallel over 7 gpus
),
####
# ResNet-101 on VGGFace2: stage 1
11: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 30 epochs on full dataset
lr=0.1, # learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='Adam',
batch_size=350, # DataParallel over 7 gpus
),
# ResNet-101 on VGGFace2: stage 2
# python vgg-face-2/train_resnet_vggface_scratch.py -c 12 -m ./vgg-face-2/logs/MODEL..-CFG-11...
12: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 30 epochs on full dataset
lr=0.01, # reduced learning rate by factor 10
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='Adam',
batch_size=350, # DataParallel over 7 gpus
),
13: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 30 epochs on full dataset
lr=0.001, # reduced learning rate by factor 10
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='Adam',
batch_size=350, # DataParallel over 7 gpus
),
# ResNet from scratch with SGD
20: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 22 epochs on full dataset
lr=0.1,
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='SGD',
batch_size=256, # DataParallel over 7 gpus
),
21: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 22 epochs on full dataset
lr=0.01,
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='SGD',
batch_size=256, # DataParallel over 7 gpus
),
22: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 22 epochs on full dataset
lr=0.001,
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='SGD',
batch_size=256, # DataParallel over 7 gpus
),
# Used to fine-tune Resnet101-512d in the second stage
# (after the new layers are converged, entire net is fine-tuned)
23: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 22 epochs on full dataset
lr=0.0001,
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='SGD',
batch_size=256, # DataParallel over 7 gpus
),
# lower learning rates on fine-tuning bottleneck (Resnet101-512d)
24: dict(
# num_iter_per_epoch = ceil(num_images/batch_size)
max_iteration=267630, # 22 epochs on full dataset
lr=0.00001, # lowered learning rate
lr_decay_epoch=None, # disable automatic lr decay
momentum=0.9,
weight_decay=0.0005,
interval_validate=200,
optim='SGD',
batch_size=256, # DataParallel over 7 gpus
),
}