tensorflow/models · error · ConfigError

Duplicate augmentation

Error message

Duplicate augmentation {augmentation!r} in {context}.

What it means

Raised in _validate_augmentations when the same augmentation is listed more than once for a prompt; duplicates are rejected for deterministic output filenames.

Solutions

  1. Remove the duplicated augmentation entry, keeping one occurrence.
  2. Deduplicate the list in any generator script that writes the config.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:506 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/44b0297e09edab0c. Report an issue: GitHub.

Appendix: source

Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:506

  Raises:
      ConfigError: If the sequence is empty, not a list, or contains an
          unknown or duplicate augmentation name.
  """
  context = f"prompts.{prompt_name!r}.augmentations"
  if not isinstance(raw_augmentations, (list, tuple)) or not raw_augmentations:
    raise ConfigError(
        f"{context} must be a non-empty list. "
        f"Allowed values: {list(CANONICAL_AUGMENTATION_ORDER)}."
    )
  seen = set()
  for augmentation in raw_augmentations:
    if augmentation not in CANONICAL_AUGMENTATION_ORDER:
      raise ConfigError(
          f"Unknown augmentation {augmentation!r} in {context}. "
          f"Allowed values: {list(CANONICAL_AUGMENTATION_ORDER)}."
      )
    if augmentation in seen:
      raise ConfigError(
          f"Duplicate augmentation {augmentation!r} in {context}."
      )
    seen.add(augmentation)
  return tuple(
      augmentation
      for augmentation in CANONICAL_AUGMENTATION_ORDER
      if augmentation in seen
  )


def _validate_detection(
    raw_detection: Any, prompt_name: str
) -> DetectionConfig:
  """Validates one prompt's detection block into a DetectionConfig.

  Args:
      raw_detection: The ``detection`` mapping read from YAML.
      prompt_name: Prompt name used in error messages.

View on GitHub (pinned to e006f5f0d5)