{"record":{"id":"98eea843dddf600b","repo":"tensorflow/models","slug":"centered-crop-is-only-supported-when-resize-eval-g","errorCode":null,"errorMessage":"centered_crop is only supported when resize_eval_groundtruth is True.","messagePattern":"centered_crop is only supported when resize_eval_groundtruth is True\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/dataloaders/segmentation_input.py","lineNumber":138,"sourceCode":"      )\n    self._gt_is_matting_map = gt_is_matting_map\n    self._groundtruth_padded_size = groundtruth_padded_size\n    self._ignore_label = ignore_label\n    self._preserve_aspect_ratio = preserve_aspect_ratio\n\n    # Data augmentation.\n    self._aug_rand_hflip = aug_rand_hflip\n    self._aug_scale_min = aug_scale_min\n    self._aug_scale_max = aug_scale_max\n\n    # dtype.\n    self._dtype = dtype\n\n    self._image_feature = image_feature\n    self._additional_dense_features = additional_dense_features\n    self._centered_crop = centered_crop\n    if self._centered_crop and not self._resize_eval_groundtruth:\n      raise ValueError(\n          'centered_crop is only supported when resize_eval_groundtruth is'\n          ' True.'\n      )\n\n  def _prepare_image_and_label(self, data):\n    \"\"\"Prepare normalized image and label.\"\"\"\n    height = data['image/height']\n    width = data['image/width']\n\n    label = tf.io.decode_image(\n        data['image/segmentation/class/encoded'], channels=1\n    )\n    label = tf.reshape(label, (1, height, width))\n    label = tf.cast(label, tf.float32)\n\n    image = tf.io.decode_image(\n        data[self._image_feature.feature_name],\n        channels=self._image_feature.num_channels,","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/dataloaders/segmentation_input.py#L120-L156","documentation":"Error \"centered_crop is only supported when resize_eval_groundtruth is True.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/dataloaders/segmentation_input.py:138 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"}