tensorflow/models · error · ConfigError

cuda_visible_devices must be a string or integer, got {raw_v

Error message

cuda_visible_devices must be a string or integer, got {raw_value!r}.

What it means

Error "cuda_visible_devices must be a string or integer, got {raw_value!r}." thrown in tensorflow/models.

Source

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

        ),
    )
  return validated


def _validate_cuda_visible_devices(raw_value: Any) -> str:
  """Validates cuda_visible_devices, allowing ints and coercing to string.

  Args:
      raw_value: The value read from YAML.

  Returns:
      The value as a string suitable for CUDA_VISIBLE_DEVICES.

  Raises:
      ConfigError: If the value is neither a string nor an integer.
  """
  if isinstance(raw_value, bool):
    raise ConfigError(
        f"cuda_visible_devices must be a string or integer, got {raw_value!r}."
    )
  if isinstance(raw_value, int):
    return str(raw_value)
  if isinstance(raw_value, str):
    return raw_value
  raise ConfigError(
      "cuda_visible_devices must be a string (quote it in YAML) or "
      f"integer, got {raw_value!r}."
  )


# ── Public loader ───────────────────────────────────────────────────────────


def load_config(config_path: str) -> PipelineConfig:
  """Reads, validates, and returns the pipeline configuration.

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:620 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/e5ca26a57bcf5bbb. Report an issue: GitHub.