tensorflow/models · error · ConfigError

{context} must be a list of exactly two integers, got {raw_c

Error message

{context} must be a list of exactly two integers, got {raw_crop_size!r}.

What it means

Error "{context} must be a list of exactly two integers, got {raw_crop_size!r}." thrown in tensorflow/models.

Source

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

def _validate_crop_size(
    raw_crop_size: Any, prompt_name: str
) -> tuple[int, int]:
  """Validates and normalizes a crop_size entry into a tuple.

  Args:
      raw_crop_size: The value read from YAML; expected to be a two-element
        sequence of positive integers.
      prompt_name: Prompt name used in the error message.

  Returns:
      The crop size as a ``(height, width)`` tuple of ints.

  Raises:
      ConfigError: If the value is not two positive integers.
  """
  context = f"prompts.{prompt_name!r}.detection.crop_size"
  if not isinstance(raw_crop_size, (list, tuple)) or len(raw_crop_size) != 2:
    raise ConfigError(
        f"{context} must be a list of exactly two integers, "
        f"got {raw_crop_size!r}."
    )
  height, width = raw_crop_size
  _require_positive_int(height, f"{context}[0]")
  _require_positive_int(width, f"{context}[1]")
  return (int(height), int(width))


def _validate_crop_variants(raw_variants: Any) -> tuple[str, ...]:
  """Validates configured crop variants against the allowed set.

  Args:
      raw_variants: The value read from YAML; expected to be a non-empty
        sequence of allowed variant names.

  Returns:
      The variants reordered to match ``ALLOWED_CROP_VARIANTS``, so on-disk

View on GitHub (pinned to e006f5f0d5)

When it happens

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