cspnext-s_8xb256-rsb-a1-600e_in1k.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. _base_ = [
  2. 'mmcls::_base_/datasets/imagenet_bs256_rsb_a12.py',
  3. 'mmcls::_base_/schedules/imagenet_bs2048_rsb.py',
  4. 'mmcls::_base_/default_runtime.py'
  5. ]
  6. model = dict(
  7. type='ImageClassifier',
  8. backbone=dict(
  9. type='mmdet.CSPNeXt',
  10. arch='P5',
  11. out_indices=(4, ),
  12. expand_ratio=0.5,
  13. deepen_factor=0.33,
  14. widen_factor=0.5,
  15. channel_attention=True,
  16. norm_cfg=dict(type='BN'),
  17. act_cfg=dict(type='mmdet.SiLU')),
  18. neck=dict(type='GlobalAveragePooling'),
  19. head=dict(
  20. type='LinearClsHead',
  21. num_classes=1000,
  22. in_channels=512,
  23. loss=dict(
  24. type='LabelSmoothLoss',
  25. label_smooth_val=0.1,
  26. mode='original',
  27. loss_weight=1.0),
  28. topk=(1, 5)),
  29. train_cfg=dict(augments=[
  30. dict(type='Mixup', alpha=0.2),
  31. dict(type='CutMix', alpha=1.0)
  32. ]))
  33. # dataset settings
  34. train_dataloader = dict(sampler=dict(type='RepeatAugSampler', shuffle=True))
  35. # schedule settings
  36. optim_wrapper = dict(
  37. optimizer=dict(weight_decay=0.01),
  38. paramwise_cfg=dict(bias_decay_mult=0., norm_decay_mult=0.),
  39. )
  40. param_scheduler = [
  41. # warm up learning rate scheduler
  42. dict(
  43. type='LinearLR',
  44. start_factor=0.0001,
  45. by_epoch=True,
  46. begin=0,
  47. end=5,
  48. # update by iter
  49. convert_to_iter_based=True),
  50. # main learning rate scheduler
  51. dict(
  52. type='CosineAnnealingLR',
  53. T_max=595,
  54. eta_min=1.0e-6,
  55. by_epoch=True,
  56. begin=5,
  57. end=600)
  58. ]
  59. train_cfg = dict(by_epoch=True, max_epochs=600)