tensorflow/models · error · ConfigError

{context}[{index}] must be an integer, got {channel_value!r}

Error message

{context}[{index}] must be an integer, got {channel_value!r}.

What it means

Error "{context}[{index}] must be an integer, got {channel_value!r}." thrown in tensorflow/models.

Source

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

      raw_color: The value read from YAML; expected to be a three-element
        sequence of integers in the range ``[0, 255]``.

  Returns:
      The color as an ``(r, g, b)`` tuple of ints.

  Raises:
      ConfigError: If the value is not three integers in the allowed range.
  """
  context = "rotation_fill_color"
  if not isinstance(raw_color, (list, tuple)) or len(raw_color) != 3:
    raise ConfigError(
        f"{context} must be a list of exactly three integers "
        f"in [{_MIN_RGB_VALUE}, {_MAX_RGB_VALUE}], got {raw_color!r}."
    )
  channels = []
  for index, channel_value in enumerate(raw_color):
    if isinstance(channel_value, bool) or not isinstance(channel_value, int):
      raise ConfigError(
          f"{context}[{index}] must be an integer, got {channel_value!r}."
      )
    if not _MIN_RGB_VALUE <= channel_value <= _MAX_RGB_VALUE:
      raise ConfigError(
          f"{context}[{index}] must be in "
          f"[{_MIN_RGB_VALUE}, {_MAX_RGB_VALUE}], got {channel_value!r}."
      )
    channels.append(int(channel_value))
  return (channels[0], channels[1], channels[2])


def _validate_augmentations(
    raw_augmentations: Any, prompt_name: str
) -> tuple[str, ...]:
  """Validates a prompt's augmentation list against the canonical set.

  Args:
      raw_augmentations: The value read from YAML; expected to be a non-empty

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:462 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/6b2707fad0ee8e2a. Report an issue: GitHub.