{"record":{"id":"e1701b69cde6834d","repo":"open-mmlab/mmdetection","slug":"self-class-name-got-empty-self-results-e1701b","errorCode":null,"errorMessage":"{self.__class__.__name__} got empty `self.results`. Please ensure that the processed results are properly added into `self.results` in `process` method.","messagePattern":"(.+?) got empty `self\\.results`\\. Please ensure that the processed results are properly added into `self\\.results` in `process` method\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/evaluation/metrics/coco_video_metric.py","lineNumber":57,"sourceCode":"                    img_data_sample = video_data_samples[frame_id].to_dict()\n                    super().process(None, [img_data_sample])\n            else:\n                # image process\n                img_data_sample = video_data_samples[0].to_dict()\n                super().process(None, [img_data_sample])\n\n    def evaluate(self, size: int = 1) -> dict:\n        \"\"\"Evaluate the model performance of the whole dataset after processing\n        all batches.\n\n        Args:\n            size (int): Length of the entire validation dataset.\n        Returns:\n            dict: Evaluation metrics dict on the val dataset. The keys are the\n            names of the metrics, and the values are corresponding results.\n        \"\"\"\n        if len(self.results) == 0:\n            warnings.warn(\n                f'{self.__class__.__name__} got empty `self.results`. Please '\n                'ensure that the processed results are properly added into '\n                '`self.results` in `process` method.')\n\n        results = collect_tracking_results(self.results, self.collect_device)\n\n        if is_main_process():\n            _metrics = self.compute_metrics(results)  # type: ignore\n            # Add prefix to metric names\n            if self.prefix:\n                _metrics = {\n                    '/'.join((self.prefix, k)): v\n                    for k, v in _metrics.items()\n                }\n            metrics = [_metrics]\n        else:\n            metrics = [None]  # type: ignore\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/coco_video_metric.py#L39-L75","documentation":"CocoVideoMetric.evaluate() warns when self.results is empty before collecting tracking results. The metric's process() never added any predictions, so COCO-style video evaluation (e.g. MOT/VID mAP) cannot be computed and returns nothing useful.","triggerScenarios":"Running video detection/tracking evaluation with CocoVideoMetric when process() was never called or never appended to self.results — empty val set, broken dataloader, or a subclass/data_sample key mismatch that silently skips appending.","commonSituations":"Misconfigured val ann_file (empty or wrong path), dataset_type/pipeline mismatch so no samples flow through process(), or subclass overrides of process() that drop results.","solutions":["Verify the val dataset length is > 0 and ann_file points to a valid annotation file","Ensure the metric is registered in val_evaluator and the loop actually calls metric.process(data_batch, data_samples)","In a custom process(), append processed samples to self.results before returning","Print len(metric.results) after one val iteration to confirm appends happen"],"exampleFix":"# before\nval_dataloader = dict(dataset=dict(ann_file='nonexistent.json'))\n# after\nval_dataloader = dict(dataset=dict(ann_file='data/anno_val.json'))\n# and confirm process appends:\ndef process(self, data_batch, data_samples):\n    self.results.extend(data_samples)","handlingStrategy":"validation","validationCode":"from mmdet.evaluation import CocoVideoMetric\nm = CocoVideoMetric(ann_file=ann)\nassert m.dataset_meta is not None\n# verify one process call populates results:\n# m.process(batch, samples); assert len(m.results) == len(samples)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate annotation files load and contain entries before eval","Log len(metric.results) after each val epoch","Ensure metric is bound to val_evaluator so process() runs"],"tags":["mmdet","coco-video","empty-results","evaluation","tracking"],"backgroundTag":"empty-evaluation-results","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}