{"record":{"id":"fb590872c087d2a4","repo":"open-mmlab/mmdetection","slug":"the-file-client-args-is-deprecated-please-use-fb5908","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/lvis_metric.py","lineNumber":129,"sourceCode":"        # proposal_nums used to compute recall or precision.\n        self.proposal_nums = list(proposal_nums)\n\n        # iou_thrs used to compute recall or precision.\n        if iou_thrs is None:\n            iou_thrs = np.linspace(\n                .5, 0.95, int(np.round((0.95 - .5) / .05)) + 1, endpoint=True)\n        self.iou_thrs = iou_thrs\n        self.metric_items = metric_items\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\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        # if ann_file is not specified,\n        # initialize lvis api with the converted dataset\n        if ann_file is not None:\n            with get_local_path(\n                    ann_file, backend_args=self.backend_args) as local_path:\n                self._lvis_api = LVIS(local_path)\n        else:\n            self._lvis_api = None\n\n        # handle dataset lazy init\n        self.cat_ids = None\n        self.img_ids = None\n","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/lvis_metric.py#L111-L147","documentation":"LVISMetric.__init__ rejects the deprecated `file_client_args` parameter with RuntimeError, same as the other mmdet v3 evaluators. The fileio layer moved to mmengine backend_args, and any non-None file_client_args triggers an immediate hard failure to force config migration.","triggerScenarios":"Building LVISMetric with file_client_args=dict(backend='disk') or any non-None value, usually inherited from an old LVIS dataset/evaluator config.","commonSituations":"Reusing an mmdet 2.x LVIS config with mmdet 3.x; copying `file_client_args` blocks from old tutorials; configs from downstream repos (e.g. old DINO/GLIP-era configs) not yet migrated.","solutions":["Delete file_client_args from the config and pass backend_args=dict(backend='disk') if non-default I/O is needed","For simple local-disk setups, omit both — backend_args=None defaults to the disk backend","Run the mmengine config migration utility over legacy configs"],"exampleFix":"// before\nval_evaluator=dict(type='LVISMetric', file_client_args=dict(backend='disk'))\n// after\nval_evaluator=dict(type='LVISMetric', backend_args=dict(backend='disk'))","handlingStrategy":"validation","validationCode":"if evaluator_cfg.get('file_client_args') is not None:\n    evaluator_cfg['backend_args'] = evaluator_cfg.pop('file_client_args')\n    # or set backend_args={'backend': 'disk'} explicitly","typeGuard":"def needs_fileio_migration(cfg: dict) -> bool:\n    return 'file_client_args' in cfg and cfg['file_client_args'] is not None","tryCatchPattern":"try:\n    evaluator = LVISMetric(**evaluator_cfg)\nexcept RuntimeError as e:\n    if 'file_client_args' in str(e):\n        evaluator_cfg.pop('file_client_args', None)\n        evaluator = LVISMetric(**evaluator_cfg)\n    else:\n        raise","preventionTips":["Migrate configs with the official tool after major upgrades","Search repos for 'file_client_args' before upgrading mmdet","Default to backend_args or no fileio args at all"],"tags":["mmdetection","deprecation","lvis","config","fileio"],"backgroundTag":"deprecated-parameter-migration","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}