prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Cannot reproduce the results of SSD-300 on WIDER_FACE
  Hi @sovrasov,
  Recently, I'm reproducing the results of SSD-300 on WIDER_FACE.
  I use the provided config based on mmdetection and get Recall 36.9, Precision 0.023 and AP 27.3.
  The results are worse than Recall 43.4, Precision 0.029 and AP 34.7 (shown in https://github.com/open-mmlab/mmdetection/pull/765#issuecomment-502579220).
  
  Generally, the models provided by mmdetection are trained on 8 gpus. So, is the SSD-300 on WIDER_FACE also trained on 8 gpus? If so, maybe I will change the learning rate because I trained the model on 4 gpus.
  
  Moreover, any other advice?
  
  Thanks a lot.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `configs/wider_face/ssd300_wider_face.py`
  Content:
  ```
  1 # model settings
  2 input_size = 300
  3 model = dict(
  4     type='SingleStageDetector',
  5     pretrained='open-mmlab://vgg16_caffe',
  6     backbone=dict(
  7         type='SSDVGG',
  8         input_size=input_size,
  9         depth=16,
  10         with_last_pool=False,
  11         ceil_mode=True,
  12         out_indices=(3, 4),
  13         out_feature_indices=(22, 34),
  14         l2_norm_scale=20),
  15     neck=None,
  16     bbox_head=dict(
  17         type='SSDHead',
  18         input_size=input_size,
  19         in_channels=(512, 1024, 512, 256, 256, 256),
  20         num_classes=2,
  21         anchor_strides=(8, 16, 32, 64, 100, 300),
  22         basesize_ratio_range=(0.15, 0.9),
  23         anchor_ratios=([2], [2, 3], [2, 3], [2, 3], [2], [2]),
  24         target_means=(.0, .0, .0, .0),
  25         target_stds=(0.1, 0.1, 0.2, 0.2)))
  26 # model training and testing settings
  27 cudnn_benchmark = True
  28 train_cfg = dict(
  29     assigner=dict(
  30         type='MaxIoUAssigner',
  31         pos_iou_thr=0.5,
  32         neg_iou_thr=0.5,
  33         min_pos_iou=0.,
  34         ignore_iof_thr=-1,
  35         gt_max_assign_all=False),
  36     smoothl1_beta=1.,
  37     allowed_border=-1,
  38     pos_weight=-1,
  39     neg_pos_ratio=3,
  40     debug=False)
  41 test_cfg = dict(
  42     nms=dict(type='nms', iou_thr=0.45),
  43     min_bbox_size=0,
  44     score_thr=0.02,
  45     max_per_img=200)
  46 # dataset settings
  47 dataset_type = 'WIDERFaceDataset'
  48 data_root = 'data/WIDERFace/'
  49 img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[1, 1, 1], to_rgb=True)
  50 train_pipeline = [
  51     dict(type='LoadImageFromFile', to_float32=True),
  52     dict(type='LoadAnnotations', with_bbox=True),
  53     dict(
  54         type='PhotoMetricDistortion',
  55         brightness_delta=32,
  56         contrast_range=(0.5, 1.5),
  57         saturation_range=(0.5, 1.5),
  58         hue_delta=18),
  59     dict(
  60         type='Expand',
  61         mean=img_norm_cfg['mean'],
  62         to_rgb=img_norm_cfg['to_rgb'],
  63         ratio_range=(1, 4)),
  64     dict(
  65         type='MinIoURandomCrop',
  66         min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),
  67         min_crop_size=0.3),
  68     dict(type='Resize', img_scale=(300, 300), keep_ratio=False),
  69     dict(type='Normalize', **img_norm_cfg),
  70     dict(type='RandomFlip', flip_ratio=0.5),
  71     dict(type='DefaultFormatBundle'),
  72     dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
  73 ]
  74 test_pipeline = [
  75     dict(type='LoadImageFromFile'),
  76     dict(
  77         type='MultiScaleFlipAug',
  78         img_scale=(300, 300),
  79         flip=False,
  80         transforms=[
  81             dict(type='Resize', keep_ratio=False),
  82             dict(type='Normalize', **img_norm_cfg),
  83             dict(type='ImageToTensor', keys=['img']),
  84             dict(type='Collect', keys=['img']),
  85         ])
  86 ]
  87 data = dict(
  88     imgs_per_gpu=60,
  89     workers_per_gpu=2,
  90     train=dict(
  91         type='RepeatDataset',
  92         times=2,
  93         dataset=dict(
  94             type=dataset_type,
  95             ann_file=data_root + 'train.txt',
  96             img_prefix=data_root + 'WIDER_train/',
  97             min_size=17,
  98             pipeline=train_pipeline)),
  99     val=dict(
  100         type=dataset_type,
  101         ann_file=data_root + 'val.txt',
  102         img_prefix=data_root + 'WIDER_val/',
  103         pipeline=test_pipeline),
  104     test=dict(
  105         type=dataset_type,
  106         ann_file=data_root + 'val.txt',
  107         img_prefix=data_root + 'WIDER_val/',
  108         pipeline=test_pipeline))
  109 # optimizer
  110 optimizer = dict(type='SGD', lr=1e-3, momentum=0.9, weight_decay=5e-4)
  111 optimizer_config = dict()
  112 # learning policy
  113 lr_config = dict(
  114     policy='step',
  115     warmup='linear',
  116     warmup_iters=1000,
  117     warmup_ratio=1.0 / 3,
  118     step=[16, 20])
  119 checkpoint_config = dict(interval=1)
  120 # yapf:disable
  121 log_config = dict(
  122     interval=1,
  123     hooks=[
  124         dict(type='TextLoggerHook'),
  125         # dict(type='TensorboardLoggerHook')
  126     ])
  127 # yapf:enable
  128 # runtime settings
  129 total_epochs = 24
  130 dist_params = dict(backend='nccl')
  131 log_level = 'INFO'
  132 work_dir = './work_dirs/ssd300_wider'
  133 load_from = None
  134 resume_from = None
  135 workflow = [('train', 1)]
  136
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/configs/wider_face/ssd300_wider_face.py b/configs/wider_face/ssd300_wider_face.py
  --- a/configs/wider_face/ssd300_wider_face.py
  +++ b/configs/wider_face/ssd300_wider_face.py
  @@ -107,7 +107,7 @@
           img_prefix=data_root + 'WIDER_val/',
           pipeline=test_pipeline))
   # optimizer
  -optimizer = dict(type='SGD', lr=1e-3, momentum=0.9, weight_decay=5e-4)
  +optimizer = dict(type='SGD', lr=0.012, momentum=0.9, weight_decay=5e-4)
   optimizer_config = dict()
   # learning policy
   lr_config = dict(
  
verification_info: {"golden_diff": "diff --git a/configs/wider_face/ssd300_wider_face.py b/configs/wider_face/ssd300_wider_face.py\n--- a/configs/wider_face/ssd300_wider_face.py\n+++ b/configs/wider_face/ssd300_wider_face.py\n@@ -107,7 +107,7 @@\n         img_prefix=data_root + 'WIDER_val/',\n         pipeline=test_pipeline))\n # optimizer\n-optimizer = dict(type='SGD', lr=1e-3, momentum=0.9, weight_decay=5e-4)\n+optimizer = dict(type='SGD', lr=0.012, momentum=0.9, weight_decay=5e-4)\n optimizer_config = dict()\n # learning policy\n lr_config = dict(\n", "issue": "Cannot reproduce the results of SSD-300 on WIDER_FACE\nHi @sovrasov,\r\nRecently, I'm reproducing the results of SSD-300 on WIDER_FACE.\r\nI use the provided config based on mmdetection and get Recall 36.9, Precision 0.023 and AP 27.3.\r\nThe results are worse than Recall 43.4, Precision 0.029 and AP 34.7 (shown in https://github.com/open-mmlab/mmdetection/pull/765#issuecomment-502579220).\r\n\r\nGenerally, the models provided by mmdetection are trained on 8 gpus. So, is the SSD-300 on WIDER_FACE also trained on 8 gpus? If so, maybe I will change the learning rate because I trained the model on 4 gpus.\r\n\r\nMoreover, any other advice?\r\n\r\nThanks a lot.\r\n\n", "before_files": [{"content": "# model settings\ninput_size = 300\nmodel = dict(\n    type='SingleStageDetector',\n    pretrained='open-mmlab://vgg16_caffe',\n    backbone=dict(\n        type='SSDVGG',\n        input_size=input_size,\n        depth=16,\n        with_last_pool=False,\n        ceil_mode=True,\n        out_indices=(3, 4),\n        out_feature_indices=(22, 34),\n        l2_norm_scale=20),\n    neck=None,\n    bbox_head=dict(\n        type='SSDHead',\n        input_size=input_size,\n        in_channels=(512, 1024, 512, 256, 256, 256),\n        num_classes=2,\n        anchor_strides=(8, 16, 32, 64, 100, 300),\n        basesize_ratio_range=(0.15, 0.9),\n        anchor_ratios=([2], [2, 3], [2, 3], [2, 3], [2], [2]),\n        target_means=(.0, .0, .0, .0),\n        target_stds=(0.1, 0.1, 0.2, 0.2)))\n# model training and testing settings\ncudnn_benchmark = True\ntrain_cfg = dict(\n    assigner=dict(\n        type='MaxIoUAssigner',\n        pos_iou_thr=0.5,\n        neg_iou_thr=0.5,\n        min_pos_iou=0.,\n        ignore_iof_thr=-1,\n        gt_max_assign_all=False),\n    smoothl1_beta=1.,\n    allowed_border=-1,\n    pos_weight=-1,\n    neg_pos_ratio=3,\n    debug=False)\ntest_cfg = dict(\n    nms=dict(type='nms', iou_thr=0.45),\n    min_bbox_size=0,\n    score_thr=0.02,\n    max_per_img=200)\n# dataset settings\ndataset_type = 'WIDERFaceDataset'\ndata_root = 'data/WIDERFace/'\nimg_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[1, 1, 1], to_rgb=True)\ntrain_pipeline = [\n    dict(type='LoadImageFromFile', to_float32=True),\n    dict(type='LoadAnnotations', with_bbox=True),\n    dict(\n        type='PhotoMetricDistortion',\n        brightness_delta=32,\n        contrast_range=(0.5, 1.5),\n        saturation_range=(0.5, 1.5),\n        hue_delta=18),\n    dict(\n        type='Expand',\n        mean=img_norm_cfg['mean'],\n        to_rgb=img_norm_cfg['to_rgb'],\n        ratio_range=(1, 4)),\n    dict(\n        type='MinIoURandomCrop',\n        min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),\n        min_crop_size=0.3),\n    dict(type='Resize', img_scale=(300, 300), keep_ratio=False),\n    dict(type='Normalize', **img_norm_cfg),\n    dict(type='RandomFlip', flip_ratio=0.5),\n    dict(type='DefaultFormatBundle'),\n    dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),\n]\ntest_pipeline = [\n    dict(type='LoadImageFromFile'),\n    dict(\n        type='MultiScaleFlipAug',\n        img_scale=(300, 300),\n        flip=False,\n        transforms=[\n            dict(type='Resize', keep_ratio=False),\n            dict(type='Normalize', **img_norm_cfg),\n            dict(type='ImageToTensor', keys=['img']),\n            dict(type='Collect', keys=['img']),\n        ])\n]\ndata = dict(\n    imgs_per_gpu=60,\n    workers_per_gpu=2,\n    train=dict(\n        type='RepeatDataset',\n        times=2,\n        dataset=dict(\n            type=dataset_type,\n            ann_file=data_root + 'train.txt',\n            img_prefix=data_root + 'WIDER_train/',\n            min_size=17,\n            pipeline=train_pipeline)),\n    val=dict(\n        type=dataset_type,\n        ann_file=data_root + 'val.txt',\n        img_prefix=data_root + 'WIDER_val/',\n        pipeline=test_pipeline),\n    test=dict(\n        type=dataset_type,\n        ann_file=data_root + 'val.txt',\n        img_prefix=data_root + 'WIDER_val/',\n        pipeline=test_pipeline))\n# optimizer\noptimizer = dict(type='SGD', lr=1e-3, momentum=0.9, weight_decay=5e-4)\noptimizer_config = dict()\n# learning policy\nlr_config = dict(\n    policy='step',\n    warmup='linear',\n    warmup_iters=1000,\n    warmup_ratio=1.0 / 3,\n    step=[16, 20])\ncheckpoint_config = dict(interval=1)\n# yapf:disable\nlog_config = dict(\n    interval=1,\n    hooks=[\n        dict(type='TextLoggerHook'),\n        # dict(type='TensorboardLoggerHook')\n    ])\n# yapf:enable\n# runtime settings\ntotal_epochs = 24\ndist_params = dict(backend='nccl')\nlog_level = 'INFO'\nwork_dir = './work_dirs/ssd300_wider'\nload_from = None\nresume_from = None\nworkflow = [('train', 1)]\n", "path": "configs/wider_face/ssd300_wider_face.py"}], "after_files": [{"content": "# model settings\ninput_size = 300\nmodel = dict(\n    type='SingleStageDetector',\n    pretrained='open-mmlab://vgg16_caffe',\n    backbone=dict(\n        type='SSDVGG',\n        input_size=input_size,\n        depth=16,\n        with_last_pool=False,\n        ceil_mode=True,\n        out_indices=(3, 4),\n        out_feature_indices=(22, 34),\n        l2_norm_scale=20),\n    neck=None,\n    bbox_head=dict(\n        type='SSDHead',\n        input_size=input_size,\n        in_channels=(512, 1024, 512, 256, 256, 256),\n        num_classes=2,\n        anchor_strides=(8, 16, 32, 64, 100, 300),\n        basesize_ratio_range=(0.15, 0.9),\n        anchor_ratios=([2], [2, 3], [2, 3], [2, 3], [2], [2]),\n        target_means=(.0, .0, .0, .0),\n        target_stds=(0.1, 0.1, 0.2, 0.2)))\n# model training and testing settings\ncudnn_benchmark = True\ntrain_cfg = dict(\n    assigner=dict(\n        type='MaxIoUAssigner',\n        pos_iou_thr=0.5,\n        neg_iou_thr=0.5,\n        min_pos_iou=0.,\n        ignore_iof_thr=-1,\n        gt_max_assign_all=False),\n    smoothl1_beta=1.,\n    allowed_border=-1,\n    pos_weight=-1,\n    neg_pos_ratio=3,\n    debug=False)\ntest_cfg = dict(\n    nms=dict(type='nms', iou_thr=0.45),\n    min_bbox_size=0,\n    score_thr=0.02,\n    max_per_img=200)\n# dataset settings\ndataset_type = 'WIDERFaceDataset'\ndata_root = 'data/WIDERFace/'\nimg_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[1, 1, 1], to_rgb=True)\ntrain_pipeline = [\n    dict(type='LoadImageFromFile', to_float32=True),\n    dict(type='LoadAnnotations', with_bbox=True),\n    dict(\n        type='PhotoMetricDistortion',\n        brightness_delta=32,\n        contrast_range=(0.5, 1.5),\n        saturation_range=(0.5, 1.5),\n        hue_delta=18),\n    dict(\n        type='Expand',\n        mean=img_norm_cfg['mean'],\n        to_rgb=img_norm_cfg['to_rgb'],\n        ratio_range=(1, 4)),\n    dict(\n        type='MinIoURandomCrop',\n        min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),\n        min_crop_size=0.3),\n    dict(type='Resize', img_scale=(300, 300), keep_ratio=False),\n    dict(type='Normalize', **img_norm_cfg),\n    dict(type='RandomFlip', flip_ratio=0.5),\n    dict(type='DefaultFormatBundle'),\n    dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),\n]\ntest_pipeline = [\n    dict(type='LoadImageFromFile'),\n    dict(\n        type='MultiScaleFlipAug',\n        img_scale=(300, 300),\n        flip=False,\n        transforms=[\n            dict(type='Resize', keep_ratio=False),\n            dict(type='Normalize', **img_norm_cfg),\n            dict(type='ImageToTensor', keys=['img']),\n            dict(type='Collect', keys=['img']),\n        ])\n]\ndata = dict(\n    imgs_per_gpu=60,\n    workers_per_gpu=2,\n    train=dict(\n        type='RepeatDataset',\n        times=2,\n        dataset=dict(\n            type=dataset_type,\n            ann_file=data_root + 'train.txt',\n            img_prefix=data_root + 'WIDER_train/',\n            min_size=17,\n            pipeline=train_pipeline)),\n    val=dict(\n        type=dataset_type,\n        ann_file=data_root + 'val.txt',\n        img_prefix=data_root + 'WIDER_val/',\n        pipeline=test_pipeline),\n    test=dict(\n        type=dataset_type,\n        ann_file=data_root + 'val.txt',\n        img_prefix=data_root + 'WIDER_val/',\n        pipeline=test_pipeline))\n# optimizer\noptimizer = dict(type='SGD', lr=0.012, momentum=0.9, weight_decay=5e-4)\noptimizer_config = dict()\n# learning policy\nlr_config = dict(\n    policy='step',\n    warmup='linear',\n    warmup_iters=1000,\n    warmup_ratio=1.0 / 3,\n    step=[16, 20])\ncheckpoint_config = dict(interval=1)\n# yapf:disable\nlog_config = dict(\n    interval=1,\n    hooks=[\n        dict(type='TextLoggerHook'),\n        # dict(type='TensorboardLoggerHook')\n    ])\n# yapf:enable\n# runtime settings\ntotal_epochs = 24\ndist_params = dict(backend='nccl')\nlog_level = 'INFO'\nwork_dir = './work_dirs/ssd300_wider'\nload_from = None\nresume_from = None\nworkflow = [('train', 1)]\n", "path": "configs/wider_face/ssd300_wider_face.py"}]}