{"record":{"id":"3a1568d26d04f293","repo":"tensorflow/models","slug":"s-is-missing-in-outputs-requried-s-found-s-3a1568","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/retinanet_model.py","lineNumber":134,"sourceCode":"\n  def build_model(self, params, mode=None):\n    if self._keras_model is None:\n      outputs = self.model_outputs(self._input_layer, mode)\n\n      model = tf_keras.models.Model(\n          inputs=self._input_layer, outputs=outputs, name='retinanet')\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    # TODO(yeqing): Moves the output related part into build_outputs.\n    required_output_fields = ['cls_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    required_label_fields = ['image_info', 'groundtruths']\n    for field in required_label_fields:\n      if field not in labels:\n        raise ValueError('\"%s\" is missing in outputs, requried %s found %s' %\n                         (field, required_label_fields, labels.keys()))\n    boxes, scores, classes, valid_detections = self._generate_detections_fn(\n        outputs['box_outputs'], outputs['cls_outputs'], labels['anchor_boxes'],\n        labels['image_info'][:, 1:2, :])\n    # Discards the old output tensors to save memory. The `cls_outputs` and\n    # `box_outputs` are pretty big and could potentiall lead to memory issue.\n    outputs = {\n        'source_id': labels['groundtruths']['source_id'],\n        'image_info': labels['image_info'],\n        'num_detections': valid_detections,\n        'detection_boxes': boxes,\n        'detection_classes': classes,\n        'detection_scores': scores,","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/modeling/retinanet_model.py#L116-L152","documentation":"Error \"\"%s\" is missing in outputs, requried %s found %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/modeling/retinanet_model.py:134 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"}