{"record":{"id":"6104297259f29913","repo":"tensorflow/models","slug":"missing-the-required-key-in-groundtruths","errorCode":null,"errorMessage":"Missing the required key `{}` in groundtruths!","messagePattern":"Missing the required key `(.+?)` in groundtruths!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/detection/evaluation/coco_evaluator.py","lineNumber":485,"sourceCode":"        present in the incoming `predictions` or `groundtruths`.\n    \"\"\"\n    for k in self._required_prediction_fields:\n      if k not in predictions:\n        raise ValueError(\n            'Missing the required key `{}` in predictions!'.format(k))\n    if self._need_rescale_bboxes:\n      self._process_predictions(predictions)\n    for k, v in six.iteritems(predictions):\n      if k not in self._predictions:\n        self._predictions[k] = [v]\n      else:\n        self._predictions[k].append(v)\n\n    if not self._annotation_file:\n      assert groundtruths\n      for k in self._required_groundtruth_fields:\n        if k not in groundtruths:\n          raise ValueError(\n              'Missing the required key `{}` in groundtruths!'.format(k))\n      for k, v in six.iteritems(groundtruths):\n        if k not in self._groundtruths:\n          self._groundtruths[k] = [v]\n        else:\n          self._groundtruths[k].append(v)\n\n\nclass OlnXclassEvaluator(COCOEvaluator):\n  \"\"\"COCO evaluation metric class.\"\"\"\n\n  def __init__(self, annotation_file, include_mask, need_rescale_bboxes=True,\n               use_category=True, seen_class='all'):\n    \"\"\"Constructs COCO evaluation class.\n\n    The class provides the interface to metrics_fn in TPUEstimator. The\n    _update_op() takes detections from each image and push them to\n    self.detections. The _evaluate() loads a JSON file in COCO annotation format","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/evaluation/coco_evaluator.py#L467-L503","documentation":"Error \"Missing the required key `{}` in groundtruths!\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/evaluation/coco_evaluator.py:485 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"}