tensorflow/models · error · ValueError

Augmentation policy {aug_type.type} not supported.

Error message

Augmentation policy {aug_type.type} not supported.

What it means

Error "Augmentation policy {aug_type.type} not supported." thrown in tensorflow/models.

Source

Thrown at official/vision/dataloaders/retinanet_input.py:176

            translate_const=aug_type.autoaug.translate_const)
      elif aug_type.type == 'randaug':
        logging.info('Using RandAugment.')
        self._augmenter = augment.RandAugment.build_for_detection(
            num_layers=aug_type.randaug.num_layers,
            magnitude=aug_type.randaug.magnitude,
            cutout_const=aug_type.randaug.cutout_const,
            translate_const=aug_type.randaug.translate_const,
            prob_to_apply=aug_type.randaug.prob_to_apply,
            exclude_ops=aug_type.randaug.exclude_ops)
      elif aug_type.type == 'ssd_random_crop':
        logging.info('Using SSD Random Crop.')
        self._augmenter = augment.SSDRandomCrop(
            params=aug_type.ssd_random_crop.ssd_random_crop_params,
            aspect_ratio_range=aug_type.ssd_random_crop.aspect_ratio_range,
            area_range=aug_type.ssd_random_crop.area_range,
        )
      else:
        raise ValueError(f'Augmentation policy {aug_type.type} not supported.')

    # Deprecated. Data Augmentation with AutoAugment.
    self._use_autoaugment = use_autoaugment
    self._autoaugment_policy_name = autoaugment_policy_name

    # Data type.
    self._dtype = dtype

    # Input pipeline optimization.
    self._resize_first = resize_first

    # Whether to pad image to make its size the smallest factor of 2*max_level.
    # This is needed when using FPN decoder.
    self._pad = pad

    self._keep_aspect_ratio = keep_aspect_ratio

  def _resize_and_crop_image_and_boxes(self, image, boxes, pad=True):

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/vision/dataloaders/retinanet_input.py:176 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/3ccfd0c0148e3bbe. Report an issue: GitHub.