mmdet常用配置

Author Avatar
patrickcty 6月 19, 2021
# 总的 epoch 数
total_epochs = 200
runner = dict(type='EpochBasedRunner', max_epochs=200)

# 设置 batchsize
data = dict(samples_per_gpu=2, workers_per_gpu=2)

# 验证的间隔,太短的话可能增多训练时间
evaluation = dict(metric=['bbox', 'segm'], interval=10)

# 输出参数的文件夹,默认是在项目目录下的
work_dir = ''

# 保存 checkpoint 的间隔
checkpoint_config = dict(interval=10)

# 加载检查点
load_from = 'xxxx.pth'

# 从中断的地方继续训练
resume_from = 'xxxx.pth'

根据 step 来训练

lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
total_iters = 160000
runner = dict(type='IterBasedRunner', max_iters=total_iters)
checkpoint_config = dict(by_epoch=False, interval=16000)
evaluation = dict(interval=16000, metric='mIoU')

P.S. 如果某个配置中有 _delete_=True,那么表明用当前配置覆盖掉继承的配置,不加的话仅仅只覆盖掉当前指定的配置。比如当前指定了 evaluation = dict(interval=16000, metric='mIoU'),而继承的配置中传入了三个参数,那另一个参数还是会使用原本的配置,但是加了 _delete_=True 另一个参数就不会使用原本的配置。