-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathgen_default_runtime.py
68 lines (56 loc) · 1.98 KB
/
gen_default_runtime.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
default_scope = 'mmagic'
randomness = dict(seed=2022, diff_rank_seed=True)
# env settings
dist_params = dict(backend='nccl')
# disable opencv multithreading to avoid system being overloaded
opencv_num_threads = 0
# set multi-process start method as `fork` to speed up the training
mp_start_method = 'fork'
# configure for default hooks
default_hooks = dict(
# record time of every iteration.
timer=dict(type='IterTimerHook'),
# print log every 100 iterations.
logger=dict(type='LoggerHook', interval=100, log_metric_by_epoch=False),
# save checkpoint per 10000 iterations
checkpoint=dict(
type='CheckpointHook',
interval=10000,
by_epoch=False,
max_keep_ckpts=20,
less_keys=['FID-Full-50k/fid', 'FID-50k/fid', 'swd/avg'],
greater_keys=['IS-50k/is', 'ms-ssim/avg'],
save_optimizer=True))
# config for environment
env_cfg = dict(
# whether to enable cudnn benchmark.
cudnn_benchmark=True,
# set multi process parameters.
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
# set distributed parameters.
dist_cfg=dict(backend='nccl'))
# set log level
log_level = 'INFO'
log_processor = dict(type='LogProcessor', by_epoch=False)
# load from which checkpoint
load_from = None
# whether to resume training from the loaded checkpoint
resume = None
# config for model wrapper
model_wrapper_cfg = dict(
type='MMSeparateDistributedDataParallel',
broadcast_buffers=False,
find_unused_parameters=False)
# set visualizer
vis_backends = [dict(type='VisBackend')]
visualizer = dict(type='Visualizer', vis_backends=vis_backends)
# config for training
train_cfg = dict(by_epoch=False, val_begin=1, val_interval=10000)
# config for val
val_cfg = dict(type='MultiValLoop')
val_evaluator = dict(type='Evaluator')
# config for test
test_cfg = dict(type='MultiTestLoop')
test_evaluator = dict(type='Evaluator')
# config for optim_wrapper_constructor
optim_wrapper = dict(constructor='MultiOptimWrapperConstructor')