mask-rcnn_regnetx-3.2GF_fpn_ms-3x_coco.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. _base_ = [
  2. '../_base_/models/mask-rcnn_r50_fpn.py',
  3. '../_base_/datasets/coco_instance.py',
  4. '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
  5. ]
  6. model = dict(
  7. data_preprocessor=dict(
  8. # The mean and std are used in PyCls when training RegNets
  9. mean=[103.53, 116.28, 123.675],
  10. std=[57.375, 57.12, 58.395],
  11. bgr_to_rgb=False),
  12. backbone=dict(
  13. _delete_=True,
  14. type='RegNet',
  15. arch='regnetx_3.2gf',
  16. out_indices=(0, 1, 2, 3),
  17. frozen_stages=1,
  18. norm_cfg=dict(type='BN', requires_grad=True),
  19. norm_eval=True,
  20. style='pytorch',
  21. init_cfg=dict(
  22. type='Pretrained', checkpoint='open-mmlab://regnetx_3.2gf')),
  23. neck=dict(
  24. type='FPN',
  25. in_channels=[96, 192, 432, 1008],
  26. out_channels=256,
  27. num_outs=5))
  28. train_pipeline = [
  29. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  30. dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
  31. dict(
  32. type='RandomChoiceResize',
  33. scales=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
  34. (1333, 768), (1333, 800)],
  35. keep_ratio=True),
  36. dict(type='RandomFlip', prob=0.5),
  37. dict(type='PackDetInputs')
  38. ]
  39. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
  40. optim_wrapper = dict(
  41. optimizer=dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.00005),
  42. clip_grad=dict(max_norm=35, norm_type=2))
  43. # learning policy
  44. max_epochs = 36
  45. train_cfg = dict(max_epochs=max_epochs)
  46. param_scheduler = [
  47. dict(
  48. type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500),
  49. dict(
  50. type='MultiStepLR',
  51. begin=0,
  52. end=max_epochs,
  53. by_epoch=True,
  54. milestones=[28, 34],
  55. gamma=0.1)
  56. ]