cyclic-20e.py 1.97 KB
Newer Older
1
2
3
4
5
# For nuScenes dataset, we usually evaluate the model at the end of training.
# Since the models are trained by 24 epochs by default, we set evaluation
# interval to be 20. Please change the interval accordingly if you do not
# use a default schedule.
# optimizer
jshilong's avatar
jshilong committed
6
lr = 1e-4
7
8
# This schedule is mainly used by models on nuScenes dataset
# max_norm=10 is better for SECOND
jshilong's avatar
jshilong committed
9
10
11
12
13
14
optim_wrapper = dict(
    type='OptimWrapper',
    optimizer=dict(type='AdamW', lr=lr, weight_decay=0.01),
    clip_grad=dict(max_norm=35, norm_type=2))
# learning rate
param_scheduler = [
15
16
17
18
    # learning rate scheduler
    # During the first 8 epochs, learning rate increases from 0 to lr * 10
    # during the next 12 epochs, learning rate decreases from lr * 10 to
    # lr * 1e-4
jshilong's avatar
jshilong committed
19
20
    dict(
        type='CosineAnnealingLR',
21
        T_max=8,
jshilong's avatar
jshilong committed
22
23
        eta_min=lr * 10,
        begin=0,
24
25
26
        end=8,
        by_epoch=True,
        convert_to_iter_based=True),
jshilong's avatar
jshilong committed
27
28
    dict(
        type='CosineAnnealingLR',
29
        T_max=12,
jshilong's avatar
jshilong committed
30
        eta_min=lr * 1e-4,
31
32
33
34
        begin=8,
        end=20,
        by_epoch=True,
        convert_to_iter_based=True),
35
36
37
    # momentum scheduler
    # During the first 8 epochs, momentum increases from 0 to 0.85 / 0.95
    # during the next 12 epochs, momentum increases from 0.85 / 0.95 to 1
jshilong's avatar
jshilong committed
38
    dict(
39
        type='CosineAnnealingMomentum',
40
        T_max=8,
jshilong's avatar
jshilong committed
41
42
        eta_min=0.85 / 0.95,
        begin=0,
43
44
45
        end=8,
        by_epoch=True,
        convert_to_iter_based=True),
jshilong's avatar
jshilong committed
46
    dict(
47
        type='CosineAnnealingMomentum',
48
        T_max=12,
jshilong's avatar
jshilong committed
49
        eta_min=1,
50
51
52
53
        begin=8,
        end=20,
        by_epoch=True,
        convert_to_iter_based=True)
jshilong's avatar
jshilong committed
54
]
55
56

# runtime settings
57
train_cfg = dict(by_epoch=True, max_epochs=20, val_interval=20)
58
val_cfg = dict()
jshilong's avatar
jshilong committed
59
test_cfg = dict()
60
61
62
63
64
65

# Default setting for scaling LR automatically
#   - `enable` means enable scaling LR automatically
#       or not by default.
#   - `base_batch_size` = (8 GPUs) x (4 samples per GPU).
auto_scale_lr = dict(enable=False, base_batch_size=32)