{"record":{"id":"338b5ae4b2640240","repo":"tensorflow/models","slug":"s-is-missing-in-outputs-requried-s-found-s","errorCode":null,"errorMessage":"\"%s\" is missing in outputs, requried %s found %s","messagePattern":"\"(.+?)\" is missing in outputs, requried (.+?) found (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/detection/modeling/maskrcnn_model.py","lineNumber":309,"sourceCode":"\n  def build_model(self, params, mode):\n    if self._keras_model is None:\n      input_layers = self.build_input_layers(self._params, mode)\n      outputs = self.model_outputs(input_layers, mode)\n\n      model = tf_keras.models.Model(\n          inputs=input_layers, outputs=outputs, name='maskrcnn')\n      assert model is not None, 'Fail to build tf_keras.Model.'\n      model.optimizer = self.build_optimizer()\n      self._keras_model = model\n\n    return self._keras_model\n\n  def post_processing(self, labels, outputs):\n    required_output_fields = ['class_outputs', 'box_outputs']\n    for field in required_output_fields:\n      if field not in outputs:\n        raise ValueError('\"%s\" is missing in outputs, requried %s found %s' %\n                         (field, required_output_fields, outputs.keys()))\n    predictions = {\n        'image_info': labels['image_info'],\n        'num_detections': outputs['num_detections'],\n        'detection_boxes': outputs['detection_boxes'],\n        'detection_classes': outputs['detection_classes'],\n        'detection_scores': outputs['detection_scores'],\n    }\n    if self._include_mask:\n      predictions.update({\n          'detection_masks': outputs['detection_masks'],\n      })\n\n    if 'groundtruths' in labels:\n      predictions['source_id'] = labels['groundtruths']['source_id']\n      predictions['gt_source_id'] = labels['groundtruths']['source_id']\n      predictions['gt_height'] = labels['groundtruths']['height']\n      predictions['gt_width'] = labels['groundtruths']['width']","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/modeling/maskrcnn_model.py#L291-L327","documentation":"Error \"\"%s\" is missing in outputs, requried %s found %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/modeling/maskrcnn_model.py:309 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"}