{"record":{"id":"885c349246c5282c","repo":"tensorflow/models","slug":"missing-the-required-key-in-predictions","errorCode":null,"errorMessage":"Missing the required key `{}` in predictions!","messagePattern":"Missing the required key `(.+?)` in predictions!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/detection/evaluation/coco_evaluator.py","lineNumber":471,"sourceCode":"          - num_detections: a numpy array of int of shape [batch_size].\n          - boxes: a numpy array of float of shape [batch_size, K, 4].\n          - classes: a numpy array of int of shape [batch_size, K].\n        Optional fields:\n          - is_crowds: a numpy array of int of shape [batch_size, K]. If the\n            field is absent, it is assumed that this instance is not crowd.\n          - areas: a numy array of float of shape [batch_size, K]. If the field\n            is absent, the area is calculated using either boxes or masks\n            depending on which one is available.\n          - masks: a numpy array of float of shape [batch_size, K, mask_height,\n            mask_width],\n\n    Raises:\n      ValueError: if the required prediction or groundtruth fields are not\n        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]","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/evaluation/coco_evaluator.py#L453-L489","documentation":"Error \"Missing the required key `{}` in predictions!\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/evaluation/coco_evaluator.py:471 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"}