tensorflow/models · error · ValueError

Choose to apply one of data augmentation policies: randaug a

Error message

Choose to apply one of data augmentation policies: randaug and autoaug.

What it means

Error "Choose to apply one of data augmentation policies: randaug and autoaug." thrown in tensorflow/models.

Source

Thrown at official/projects/videoglue/datasets/common/utils.py:497

      else:
        def resize_and_crop_fn(x, state=None):
          return processors.resize_and_crop(
              x,
              min_resize=min_resize,
              crop_size=crop_size,
              is_flow=False,
              is_random=False,
              state=state)
        preprocessor_builder.add_fn(
            fn=resize_and_crop_fn,
            feature_name=output_feature_name,
            fn_name='{}_resize_central_crop'.format(output_feature_name),
            stateful=sync_random_state)

  # Apply extra augmentation policy.
  if is_training:
    if randaug_params is not None and autoaug_params is not None:
      raise ValueError('Choose to apply one of data augmentation policies: '
                       'randaug and autoaug.')

    if autoaug_params is not None:
      augmenter = augment.AutoAugment(
          augmentation_name=autoaug_params['augmentation_name'],
          cutout_const=autoaug_params['cutout_const'],
          translate_const=autoaug_params['translate_const'])
      preprocessor_builder.add_fn(
          fn=augmenter.distort,
          feature_name=output_feature_name,
          fn_name='{}_autoaug'.format(output_feature_name))

    if randaug_params is not None:
      augmenter = augment.RandAugment(
          num_layers=randaug_params['num_layers'],
          magnitude=randaug_params['magnitude'],
          cutout_const=randaug_params['cutout_const'],
          translate_const=randaug_params['translate_const'],

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/videoglue/datasets/common/utils.py:497 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/0aa4927bc4464abb. Report an issue: GitHub.