retinanet_r50-syncbn_fpn_1350k_objects365v1.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. _base_ = [
  2. '../_base_/models/retinanet_r50_fpn.py',
  3. '../_base_/datasets/objects365v2_detection.py',
  4. '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
  5. ]
  6. model = dict(
  7. backbone=dict(norm_cfg=dict(type='SyncBN', requires_grad=True)),
  8. bbox_head=dict(num_classes=365))
  9. # training schedule for 1350K
  10. train_cfg = dict(
  11. _delete_=True,
  12. type='IterBasedTrainLoop',
  13. max_iters=1350000, # 36 epochs
  14. val_interval=150000)
  15. # Using 8 GPUS while training
  16. optim_wrapper = dict(
  17. type='OptimWrapper',
  18. optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001),
  19. clip_grad=dict(max_norm=35, norm_type=2))
  20. # learning rate policy
  21. param_scheduler = [
  22. dict(
  23. type='LinearLR',
  24. start_factor=1.0 / 1000,
  25. by_epoch=False,
  26. begin=0,
  27. end=10000),
  28. dict(
  29. type='MultiStepLR',
  30. begin=0,
  31. end=1350000,
  32. by_epoch=False,
  33. milestones=[900000, 1200000],
  34. gamma=0.1)
  35. ]
  36. train_dataloader = dict(sampler=dict(type='InfiniteSampler'))
  37. default_hooks = dict(checkpoint=dict(by_epoch=False, interval=150000))
  38. log_processor = dict(by_epoch=False)
  39. # NOTE: `auto_scale_lr` is for automatically scaling LR,
  40. # USER SHOULD NOT CHANGE ITS VALUES.
  41. # base_batch_size = (8 GPUs) x (2 samples per GPU)
  42. auto_scale_lr = dict(base_batch_size=16)