{"record":{"id":"96e4dda73668801f","repo":"tensorflow/models","slug":"missing-the-required-key-in-predictions-96e4dd","errorCode":null,"errorMessage":"Missing the required key `{}` in predictions!","messagePattern":"Missing the required key `(.+?)` in predictions!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/evaluation/panoptic_quality_evaluator.py","lineNumber":155,"sourceCode":"          [y_scale, x_scale], [y_offset, x_offset]], where [desired_height,\n          desired_width] is the actual scaled image size, and [y_scale, x_scale]\n          is the scaling factor, which is the ratio of scaled dimension /\n          original dimension.\n      predictions: a dictionary of tensors including the fields below. See\n        different parsers under `../dataloader` for more details.\n        Required fields:\n          - category_mask: a numpy array of uint16 of shape [batch_size, H, W].\n          - instance_mask: a numpy array of uint16 of shape [batch_size, H, W].\n\n    Raises:\n      ValueError: if the required prediction or ground-truth fields are not\n        present in the incoming `predictions` or `groundtruths`.\n    \"\"\"\n    groundtruths, predictions = self._convert_to_numpy(groundtruths,\n                                                       predictions)\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\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\n    if self._rescale_predictions:\n      for idx in range(len(groundtruths['category_mask'])):\n        image_info = groundtruths['image_info'][idx]\n        groundtruths_ = {\n            'category_mask':\n                _crop_padding(groundtruths['category_mask'][idx], image_info),\n            'instance_mask':\n                _crop_padding(groundtruths['instance_mask'][idx], image_info),\n            }\n        predictions_ = {\n            'category_mask':","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/evaluation/panoptic_quality_evaluator.py#L137-L173","documentation":"Error \"Missing the required key `{}` in predictions!\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/evaluation/panoptic_quality_evaluator.py:155 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"}