{"record":{"id":"8f87bfab1b47d518","repo":"open-mmlab/mmdetection","slug":"gpu-collecting-has-not-been-supported-yet","errorCode":null,"errorMessage":"GPU collecting has not been supported yet","messagePattern":"GPU collecting has not been supported yet","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"mmdet/evaluation/metrics/base_video_metric.py","lineNumber":114,"sourceCode":"    Args:\n        results (list): Result list containing result parts to be\n            collected. Each item of ``result_part`` should be a picklable\n            object.\n        device (str): Device name. Optional values are 'cpu' and 'gpu'.\n        tmpdir (str | None): Temporal directory for collected results to\n            store. If set to None, it will create a temporal directory for it.\n            ``tmpdir`` should be None when device is 'gpu'. Defaults to None.\n\n    Returns:\n        list or None: The collected results.\n    \"\"\"\n    if device not in ['gpu', 'cpu']:\n        raise NotImplementedError(\n            f\"device must be 'cpu' or 'gpu', but got {device}\")\n\n    if device == 'gpu':\n        assert tmpdir is None, 'tmpdir should be None when device is \"gpu\"'\n        raise NotImplementedError('GPU collecting has not been supported yet')\n    else:\n        return collect_tracking_results_cpu(results, tmpdir)\n\n\ndef collect_tracking_results_cpu(result_part: list,\n                                 tmpdir: Optional[str] = None\n                                 ) -> Optional[list]:\n    \"\"\"Collect results on cpu mode.\n\n    Saves the results on different gpus to 'tmpdir' and collects them by the\n    rank 0 worker.\n\n    Args:\n        result_part (list): The part of prediction results.\n        tmpdir (str): Path of directory to save the temporary results from\n            different gpus under cpu mode. If is None, use `tempfile.mkdtemp()`\n            to make a temporary path. Defaults to None.\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/base_video_metric.py#L96-L132","documentation":"Even though 'gpu' is accepted as a device name, GPU result collection has never been implemented; after asserting tmpdir is None it unconditionally raises NotImplementedError. In practice only CPU collection works.","triggerScenarios":"Configuring any video tracking metric (e.g. MOTMetric, YouTubeVISMetric) with collect_device='gpu' and running distributed evaluation.","commonSituations":"Users assuming GPU collection is faster and flipping collect_device; copy from older configs that suggested 'gpu'.","solutions":["Use collect_device='cpu' for all video metrics","Keep tmpdir=None when doing so is irrelevant; for cpu you may pass tmpdir for multi-node gathering"],"exampleFix":"# before\nMOTMetric(collect_device='gpu')\n# after\nMOTMetric(collect_device='cpu')","handlingStrategy":"fallback","validationCode":"if collect_device == 'gpu':\n    collect_device = 'cpu'  # GPU collecting unsupported; use CPU","typeGuard":null,"tryCatchPattern":"try:\n    metric.evaluate()\nexcept NotImplementedError as e:\n    if 'GPU collecting' in str(e):\n        metric.collect_device = 'cpu'\n        metric.evaluate()\n    else:\n        raise","preventionTips":["Always use collect_device='cpu' for video metrics","Avoid 'gpu' until the feature is implemented upstream"],"tags":["video-metric","gpu-unsupported","mmdetection","distributed"],"backgroundTag":"unsupported-feature-value","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}