{"record":{"id":"0b9afe3f613c87ff","repo":"open-mmlab/mmdetection","slug":"metric-item-metric-item-is-not-supported-0b9afe","errorCode":null,"errorMessage":"metric item \"{metric_item}\" is not supported","messagePattern":"metric item \"(.+?)\" is not supported","errorType":"validation","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"mmdet/evaluation/metrics/youtube_vis_metric.py","lineNumber":163,"sourceCode":"        coco_metric_names = {\n            'mAP': 0,\n            'mAP_50': 1,\n            'mAP_75': 2,\n            'mAP_s': 3,\n            'mAP_m': 4,\n            'mAP_l': 5,\n            'AR@1': 6,\n            'AR@10': 7,\n            'AR@100': 8,\n            'AR_s@100': 9,\n            'AR_m@100': 10,\n            'AR_l@100': 11\n        }\n        metric_items = self.metric_items\n        if metric_items is not None:\n            for metric_item in metric_items:\n                if metric_item not in coco_metric_names:\n                    raise KeyError(\n                        f'metric item \"{metric_item}\" is not supported')\n\n        if metric_items is None:\n            metric_items = [\n                'mAP', 'mAP_50', 'mAP_75', 'mAP_s', 'mAP_m', 'mAP_l'\n            ]\n        for metric_item in metric_items:\n            key = f'{metric}_{metric_item}'\n            val = float(\n                f'{ytvisEval.stats[coco_metric_names[metric_item]]:.3f}')\n            eval_results[key] = val\n\n        return eval_results\n\n    def format_gts(self, gts: Tuple[List]) -> dict:\n        \"\"\"Gather all ground-truth from self.results.\"\"\"\n        self.categories = [\n            dict(id=id + 1, name=name)","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/youtube_vis_metric.py#L145-L181","documentation":"YouTubeVisMetric.compute_metrics validates optional metric_items against the coco_metric_names table (mAP, mAP_50, mAP_75, mAP_s, mAP_m, mAP_l, AR@100, AR_l@100, ...). Unknown or misspelled items raise this KeyError when evaluation runs.","triggerScenarios":"Passing metric_items=['AP50','AP','AR'] or any name not in the table; evaluation-time failure even though construction succeeded.","commonSituations":"Reusing metric_items lists written for CocoMetric AR@1000 variants that the YouTube-VIS table omits; hand-writing item names from papers.","solutions":["Use only names present in the metric's coco_metric_names dict (mAP, mAP_50, mAP_75, mAP_s, mAP_m, mAP_l, AR@100, AR_l@100, etc.)","Omit metric_items to get the default set (mAP, mAP_50, mAP_75, mAP_s, mAP_m, mAP_l)","Inspect the dict at the raise site in your installed version for exact keys"],"exampleFix":"# before\nval_evaluator = dict(type='YouTubeVisMetric', metric='youtube_vis_ap', metric_items=['AP50'])\n# after\nval_evaluator = dict(type='YouTubeVisMetric', metric='youtube_vis_ap', metric_items=['mAP_50'])","handlingStrategy":"validation","validationCode":"SUPPORTED = {'mAP','mAP_50','mAP_75','mAP_s','mAP_m','mAP_l','AR@100','AR@300','AR@1000','AR_s@1000','AR_m@1000','AR_l@1000'}\nassert metric_items is None or set(metric_items) <= SUPPORTED","typeGuard":"def valid_vis_items(items) -> bool:\n    S = {'mAP','mAP_50','mAP_75','mAP_s','mAP_m','mAP_l','AR@100','AR@300','AR@1000','AR_s@1000','AR_m@1000','AR_l@1000'}\n    return items is None or set(items) <= S","tryCatchPattern":"try:\n    evaluator.compute_metrics(results)\nexcept KeyError as e:\n    logging.error('invalid metric_items: %s', e); raise","preventionTips":["Omit metric_items to use defaults","Verify items against the metric's coco_metric_names dict","Avoid hand-typing item names"],"tags":["mmdet","youtube-vis","metric-items","evaluation"],"backgroundTag":null,"analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}