{"record":{"id":"c153a5d9d1ebf84f","repo":"open-mmlab/mmdetection","slug":"metric-item-metric-item-is-not-supported-c153a5","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/ov_coco_metric.py","lineNumber":138,"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@100': 6,\n                'AR@300': 7,\n                'AR@1000': 8,\n                'AR_s@1000': 9,\n                'AR_m@1000': 10,\n                'AR_l@1000': 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 == 'proposal':\n                coco_eval.params.useCats = 0\n                coco_eval.evaluate()\n                coco_eval.accumulate()\n                coco_eval.summarize()\n                if metric_items is None:\n                    metric_items = [\n                        'AR@100', 'AR@300', 'AR@1000', 'AR_s@1000',\n                        'AR_m@1000', 'AR_l@1000'\n                    ]\n\n                for item in metric_items:\n                    val = float(\n                        f'{coco_eval.stats[coco_metric_names[item]]:.3f}')\n                    eval_results[item] = val\n            else:","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/ov_coco_metric.py#L120-L156","documentation":"OV-COCOMetric validates self.metric_items against the fixed set of coco_metric_names keys (mAP, mAP_50, ..., AR_l@1000). Any item not in that table raises this KeyError, because the metric cannot compute an unknown statistic.","triggerScenarios":"Passing metric_items=['mAP@0.5:0.95', 'AP50', 'AR@100'] or other non-standard names to OVCocoMetric; misspelling a supported item like 'mAP_50'.","commonSituations":"Copy-pasting metric_items strings from pycocotools logs or papers instead of the supported keys; version changes renaming items; mixing Pascal VOC item names into a COCO evaluator.","solutions":["Use only supported items: 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","Leave metric_items=None to get the default set (mAP, mAP_50, mAP_75, mAP_s, mAP_m, mAP_l)","Check the coco_metric_names dict in the source for the exact accepted keys of your mmdet version"],"exampleFix":"# before\nval_evaluator = dict(type='OVCocoMetric', metric='bbox', metric_items=['AP50', 'AP75'])\n# after\nval_evaluator = dict(type='OVCocoMetric', metric='bbox', metric_items=['mAP_50', 'mAP_75'])","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'}\nbad = set(metric_items or []) - SUPPORTED\nassert not bad, f'unsupported metric_items: {bad}'","typeGuard":"def is_valid_metric_items(items) -> bool:\n    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'}\n    return items is None or all(i in SUPPORTED for i in items)","tryCatchPattern":"try:\n    evaluator.evaluate(results)\nexcept KeyError as e:\n    raise ValueError(f'fix metric_items in config: {e}') from e","preventionTips":["Copy metric_items from official mmdet COCO configs","Leave metric_items unset for the defaults","Check coco_metric_names keys in the installed version"],"tags":["mmdet","evaluation","coco-metric","metric-items","validation"],"backgroundTag":null,"analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}