{"record":{"id":"aeb265c2c03e9212","repo":"tensorflow/models","slug":"include-panoptic-masks-should-be-set-to-true-whe","errorCode":null,"errorMessage":"`include_panoptic_masks` should be set to True when computing panoptic quality.","messagePattern":"`include_panoptic_masks` should be set to True when computing panoptic quality\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/panoptic/tasks/panoptic_maskrcnn.py","lineNumber":287,"sourceCode":"            dtype=tf.float32,\n        )\n    else:\n      rescale_predictions = (\n          not self.task_config.validation_data.parser.segmentation_resize_eval_groundtruth\n      )\n      self.segmentation_perclass_iou_metric = segmentation_metrics.PerClassIoU(\n          name='per_class_iou',\n          num_classes=self.task_config.model.segmentation_model.num_classes,\n          rescale_predictions=rescale_predictions,\n          dtype=tf.float32,\n      )\n\n      if (\n          self.task_config.model.generate_panoptic_masks\n          and self.task_config.panoptic_quality_evaluator is not None\n      ):\n        if not self.task_config.validation_data.parser.include_panoptic_masks:\n          raise ValueError(\n              '`include_panoptic_masks` should be set to True when'\n              ' computing panoptic quality.'\n          )\n        pq_config = self.task_config.panoptic_quality_evaluator\n        self.panoptic_quality_metric = panoptic_quality.PanopticQualityV2(\n            num_categories=pq_config.num_categories,\n            is_thing=pq_config.is_thing,\n            ignored_label=pq_config.ignored_label,\n            rescale_predictions=pq_config.rescale_predictions,\n        )\n\n    return metrics\n\n  def train_step(self,\n                 inputs: Tuple[Any, Any],\n                 model: tf_keras.Model,\n                 optimizer: tf_keras.optimizers.Optimizer,\n                 metrics: Optional[List[Any]] = None) -> Dict[str, Any]:","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/panoptic/tasks/panoptic_maskrcnn.py#L269-L305","documentation":"Error \"`include_panoptic_masks` should be set to True when computing panoptic quality.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/panoptic/tasks/panoptic_maskrcnn.py:287 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"}