mask-rcnn_r50_fpn_1x_cityscapes.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. _base_ = [
  2. '../_base_/models/mask-rcnn_r50_fpn.py',
  3. '../_base_/datasets/cityscapes_instance.py',
  4. '../_base_/default_runtime.py', '../_base_/schedules/schedule_1x.py'
  5. ]
  6. model = dict(
  7. backbone=dict(init_cfg=None),
  8. roi_head=dict(
  9. bbox_head=dict(
  10. type='Shared2FCBBoxHead',
  11. num_classes=8,
  12. loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)),
  13. mask_head=dict(num_classes=8)))
  14. # optimizer
  15. # lr is set for a batch size of 8
  16. optim_wrapper = dict(optimizer=dict(lr=0.01))
  17. # learning rate
  18. param_scheduler = [
  19. dict(
  20. type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500),
  21. dict(
  22. type='MultiStepLR',
  23. begin=0,
  24. end=8,
  25. by_epoch=True,
  26. # [7] yields higher performance than [6]
  27. milestones=[7],
  28. gamma=0.1)
  29. ]
  30. # actual epoch = 8 * 8 = 64
  31. train_cfg = dict(max_epochs=8)
  32. # For better, more stable performance initialize from COCO
  33. load_from = 'https://download.openmmlab.com/mmdetection/v2.0/mask_rcnn/mask_rcnn_r50_fpn_1x_coco/mask_rcnn_r50_fpn_1x_coco_20200205-d4b0c5d6.pth' # noqa
  34. # NOTE: `auto_scale_lr` is for automatically scaling LR,
  35. # USER SHOULD NOT CHANGE ITS VALUES.
  36. # base_batch_size = (8 GPUs) x (1 samples per GPU)
  37. # TODO: support auto scaling lr
  38. # auto_scale_lr = dict(base_batch_size=8)