{"record":{"id":"477b483654cfa5c6","repo":"open-mmlab/mmdetection","slug":"in-rpn-proposal-or-test-cfg-nms-thr-has-been-move","errorCode":null,"errorMessage":"In rpn_proposal or test_cfg, nms_thr has been moved to a dict named nms as iou_threshold, max_num has been renamed as max_per_img, name of original arguments and the way to specify iou_threshold of NMS will be deprecated.","messagePattern":"In rpn_proposal or test_cfg, nms_thr has been moved to a dict named nms as iou_threshold, max_num has been renamed as max_per_img, name of original arguments and the way to specify iou_threshold of NMS will be deprecated\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/models/test_time_augs/merge_augs.py","lineNumber":40,"sourceCode":"            original image size.\n\n        img_metas (list[dict]): list of image info dict where each dict has:\n            'img_shape', 'scale_factor', 'flip', and may also contain\n            'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.\n            For details on the values of these keys see\n            `mmdet/datasets/pipelines/formatting.py:Collect`.\n\n        cfg (dict): rpn test config.\n\n    Returns:\n        Tensor: shape (n, 4), proposals corresponding to original image scale.\n    \"\"\"\n\n    cfg = copy.deepcopy(cfg)\n\n    # deprecate arguments warning\n    if 'nms' not in cfg or 'max_num' in cfg or 'nms_thr' in cfg:\n        warnings.warn(\n            'In rpn_proposal or test_cfg, '\n            'nms_thr has been moved to a dict named nms as '\n            'iou_threshold, max_num has been renamed as max_per_img, '\n            'name of original arguments and the way to specify '\n            'iou_threshold of NMS will be deprecated.')\n    if 'nms' not in cfg:\n        cfg.nms = ConfigDict(dict(type='nms', iou_threshold=cfg.nms_thr))\n    if 'max_num' in cfg:\n        if 'max_per_img' in cfg:\n            assert cfg.max_num == cfg.max_per_img, f'You set max_num and ' \\\n                f'max_per_img at the same time, but get {cfg.max_num} ' \\\n                f'and {cfg.max_per_img} respectively' \\\n                f'Please delete max_num which will be deprecated.'\n        else:\n            cfg.max_per_img = cfg.max_num\n    if 'nms_thr' in cfg:\n        assert cfg.nms.iou_threshold == cfg.nms_thr, f'You set ' \\\n            f'iou_threshold in nms and ' \\","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/models/test_time_augs/merge_augs.py#L22-L58","documentation":"Warning from merge_aug_proposals: the test-time RPN proposal config still uses the old flat keys nms_thr / max_num. NMS settings moved into a nested dict nms=dict(iou_threshold=..., type='nms'), and max_num was renamed max_per_img; the old flat arguments will be deprecated.","triggerScenarios":"Running multi-scale / flip augmentation testing (aug_test_rpn → merge_aug_proposals) with a test_cfg/rpn_proposal dict that lacks a 'nms' sub-dict or still contains nms_thr / max_num keys; old Faster R-CNN / two-stage configs.","commonSituations":"Reusing configs from older mmdet releases where rpn_proposal=dict(nms_thr=0.7, max_num=1000) was the schema; version upgrades change the NMS config format.","solutions":["Rewrite rpn_proposal/test_cfg to use nms=dict(type='nms', iou_threshold=0.7) and max_per_img=1000","Remove nms_thr and max_num keys","Validate test_cfg against a current config in mmdet configs/ for your model"],"exampleFix":"# before\ntest_cfg=dict(rpn_proposal=dict(nms_thr=0.7, max_num=1000))\n# after\ntest_cfg=dict(rpn_proposal=dict(nms=dict(type='nms', iou_threshold=0.7), max_per_img=1000))","handlingStrategy":"validation","validationCode":"prop = test_cfg.get('rpn_proposal', test_cfg)\nassert 'nms' in prop and 'nms_thr' not in prop and 'max_num' not in prop, 'migrate nms_thr/max_num to nms.iou_threshold/max_per_img'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate test_cfg from current config zoo after upgrades","Validate rpn_proposal schema before aug-test runs"],"tags":["mmdet","deprecation","nms-config","test-cfg","aug-test"],"backgroundTag":"deprecated-config-schema-migrated","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}