tensorflow/models · error · ValueError

"{}" is missing in labels, requried {} found {}

Error message

"{}" is missing in labels, requried {} found {}

What it means

Error ""{}" is missing in labels, requried {} found {}" thrown in tensorflow/models.

Source

Thrown at official/legacy/detection/modeling/shapemask_model.py:283

    return self._keras_model

  def post_processing(self, labels, outputs):
    required_output_fields = [
        'num_detections', 'detection_boxes', 'detection_classes',
        'detection_masks', 'detection_scores'
    ]

    for field in required_output_fields:
      if field not in outputs:
        raise ValueError(
            '"{}" is missing in outputs, requried {} found {}'.format(
                field, required_output_fields, outputs.keys()))

    required_label_fields = ['image_info']
    for field in required_label_fields:
      if field not in labels:
        raise ValueError(
            '"{}" is missing in labels, requried {} found {}'.format(
                field, required_label_fields, labels.keys()))

    predictions = {
        'image_info': labels['image_info'],
        'num_detections': outputs['num_detections'],
        'detection_boxes': outputs['detection_boxes'],
        'detection_outer_boxes': outputs['detection_outer_boxes'],
        'detection_classes': outputs['detection_classes'],
        'detection_scores': outputs['detection_scores'],
        'detection_masks': outputs['detection_masks'],
    }

    if 'groundtruths' in labels:
      predictions['source_id'] = labels['groundtruths']['source_id']
      labels = labels['groundtruths']

    return labels, predictions

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/legacy/detection/modeling/shapemask_model.py:283 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/c8a164865ab77720. Report an issue: GitHub.