{"record":{"id":"abf5b88075ef0918","repo":"tensorflow/models","slug":"results-do-not-correspond-to-the-current-dataset-abf5b8","errorCode":null,"errorMessage":"Results do not correspond to the current dataset!","messagePattern":"Results do not correspond to the current dataset!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/evaluation/coco_utils.py","lineNumber":90,"sourceCode":"    Args:\n      predictions: a list of dictionary each representing an annotation in COCO\n        format. The required fields are `image_id`, `category_id`, `score`,\n        `bbox`, `segmentation`.\n\n    Returns:\n      res: result COCO api object.\n\n    Raises:\n      ValueError: if the set of image id from predctions is not the subset of\n        the set of image id of the ground-truth dataset.\n    \"\"\"\n    res = coco.COCO()\n    res.dataset['images'] = copy.deepcopy(self.dataset['images'])\n    res.dataset['categories'] = copy.deepcopy(self.dataset['categories'])\n\n    image_ids = [ann['image_id'] for ann in predictions]\n    if set(image_ids) != (set(image_ids) & set(self.getImgIds())):\n      raise ValueError('Results do not correspond to the current dataset!')\n    for ann in predictions:\n      x1, x2, y1, y2 = [ann['bbox'][0], ann['bbox'][0] + ann['bbox'][2],\n                        ann['bbox'][1], ann['bbox'][1] + ann['bbox'][3]]\n      if self._eval_type == 'box':\n        ann['area'] = ann['bbox'][2] * ann['bbox'][3]\n        ann['segmentation'] = [\n            [x1, y1, x1, y2, x2, y2, x2, y1]]\n      elif self._eval_type == 'mask':\n        ann['area'] = mask_api.area(ann['segmentation'])\n\n    res.dataset['annotations'] = copy.deepcopy(predictions)\n    res.createIndex()\n    return res\n\n\ndef convert_predictions_to_coco_annotations(predictions):\n  \"\"\"Converts a batch of predictions to annotations in COCO format.\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/evaluation/coco_utils.py#L72-L108","documentation":"Error \"Results do not correspond to the current dataset!\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/evaluation/coco_utils.py:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}