tensorflow/models · error · ValueError

`include_panoptic_masks` should be set to True when computin

Error message

`include_panoptic_masks` should be set to True when computing panoptic quality.

What it means

Error "`include_panoptic_masks` should be set to True when computing panoptic quality." thrown in tensorflow/models.

Source

Thrown at official/projects/panoptic/tasks/panoptic_maskrcnn.py:287

            dtype=tf.float32,
        )
    else:
      rescale_predictions = (
          not self.task_config.validation_data.parser.segmentation_resize_eval_groundtruth
      )
      self.segmentation_perclass_iou_metric = segmentation_metrics.PerClassIoU(
          name='per_class_iou',
          num_classes=self.task_config.model.segmentation_model.num_classes,
          rescale_predictions=rescale_predictions,
          dtype=tf.float32,
      )

      if (
          self.task_config.model.generate_panoptic_masks
          and self.task_config.panoptic_quality_evaluator is not None
      ):
        if not self.task_config.validation_data.parser.include_panoptic_masks:
          raise ValueError(
              '`include_panoptic_masks` should be set to True when'
              ' computing panoptic quality.'
          )
        pq_config = self.task_config.panoptic_quality_evaluator
        self.panoptic_quality_metric = panoptic_quality.PanopticQualityV2(
            num_categories=pq_config.num_categories,
            is_thing=pq_config.is_thing,
            ignored_label=pq_config.ignored_label,
            rescale_predictions=pq_config.rescale_predictions,
        )

    return metrics

  def train_step(self,
                 inputs: Tuple[Any, Any],
                 model: tf_keras.Model,
                 optimizer: tf_keras.optimizers.Optimizer,
                 metrics: Optional[List[Any]] = None) -> Dict[str, Any]:

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/panoptic/tasks/panoptic_maskrcnn.py:287 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/aeb265c2c03e9212. Report an issue: GitHub.