{"record":{"id":"43290ac5aae1f714","repo":"open-mmlab/mmdetection","slug":"the-file-client-args-is-deprecated-please-use-43290a","errorCode":null,"errorMessage":"The `file_client_args` is deprecated, please use `backend_args` instead, please refer tohttps://github.com/open-mmlab/mmdetection/blob/main/configs/_base_/datasets/coco_detection.py","messagePattern":"The `file_client_args` is deprecated, please use `backend_args` instead, please refer tohttps://github\\.com/open-mmlab/mmdetection/blob/main/configs/_base_/datasets/coco_detection\\.py","errorType":"validation","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"mmdet/evaluation/metrics/crowdhuman_metric.py","lineNumber":100,"sourceCode":"\n        self.ann_file = ann_file\n        # crowdhuman evaluation metrics\n        self.metrics = metric if isinstance(metric, list) else [metric]\n        allowed_metrics = ['MR', 'AP', 'JI']\n        for metric in self.metrics:\n            if metric not in allowed_metrics:\n                raise KeyError(f\"metric should be one of 'MR', 'AP', 'JI',\"\n                               f'but got {metric}.')\n\n        self.format_only = format_only\n        if self.format_only:\n            assert outfile_prefix is not None, 'outfile_prefix must be not'\n            'None when format_only is True, otherwise the result files will'\n            'be saved to a temp directory which will be cleaned up at the end.'\n        self.outfile_prefix = outfile_prefix\n        self.backend_args = backend_args\n        if file_client_args is not None:\n            raise RuntimeError(\n                'The `file_client_args` is deprecated, '\n                'please use `backend_args` instead, please refer to'\n                'https://github.com/open-mmlab/mmdetection/blob/main/configs/_base_/datasets/coco_detection.py'  # noqa: E501\n            )\n\n        assert eval_mode in [0, 1, 2], \\\n            \"Unknown eval mode. mr_ref should be one of '0', '1', '2'.\"\n        assert compare_matching_method is None or \\\n               compare_matching_method == 'VOC', \\\n               'The alternative compare_matching_method is VOC.' \\\n               'This parameter defaults to CALTECH(None)'\n        assert mr_ref == 'CALTECH_-2' or mr_ref == 'CALTECH_-4', \\\n            \"mr_ref should be one of 'CALTECH_-2', 'CALTECH_-4'.\"\n        self.eval_mode = eval_mode\n        self.iou_thres = iou_thres\n        self.compare_matching_method = compare_matching_method\n        self.mr_ref = mr_ref\n        self.num_ji_process = num_ji_process","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/crowdhuman_metric.py#L82-L118","documentation":"CrowdHumanMetric.__init__ raises RuntimeError if the legacy `file_client_args` parameter is passed — the same 3.x deprecation enforcement as CocoMetric. File I/O must be configured via `backend_args`. The message points at the canonical config showing the new backend_args style.","triggerScenarios":"CrowdHumanMetric(..., file_client_args={'backend':'disk'}) or a CrowdHuman val/test config that still carries file_client_args after upgrading mmdetection to 3.x.","commonSituations":"Porting old CrowdHuman project configs (projects/CrowdHuman) to 3.x; keeping legacy kwargs in a custom subclass or a wrapper script.","solutions":["Replace file_client_args with backend_args=dict(backend='local') (or 'petrel' with path_mapping for remote)","Strip file_client_args keys from all configs in the repo (grep for it)","Use the config referenced in the message as the migration template"],"exampleFix":"# before\nval_evaluator = dict(type='CrowdHumanMetric', metric='AP', file_client_args=dict(backend='disk'))\n# after\nval_evaluator = dict(type='CrowdHumanMetric', metric='AP', backend_args=dict(backend='local'))","handlingStrategy":"validation","validationCode":"ev = cfg.get('val_evaluator', cfg.get('test_evaluator', {}))\nassert 'file_client_args' not in ev, 'CrowdHumanMetric: use backend_args, not file_client_args'","typeGuard":"def config_is_mmdet3_compatible(eval_cfg: dict) -> bool:\n    return 'file_client_args' not in eval_cfg","tryCatchPattern":null,"preventionTips":["Migrate all project configs in one sweep (grep file_client_args)","Wrap evaluator construction in a helper that injects backend_args","Track mmdetection release notes for API migrations"],"tags":["mmdetection","crowdhuman","deprecation","migration"],"backgroundTag":"deprecated-parameter-removed","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}