{"record":{"id":"c7fc181a011197e6","repo":"tensorflow/models","slug":"cuda-visible-devices-must-be-a-string-quote-it-in","errorCode":null,"errorMessage":"cuda_visible_devices must be a string (quote it in YAML) or integer, got {raw_value!r}.","messagePattern":"cuda_visible_devices must be a string \\(quote it in YAML\\) or integer, got (.+?)\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py","lineNumber":627,"sourceCode":"\n  Args:\n      raw_value: The value read from YAML.\n\n  Returns:\n      The value as a string suitable for CUDA_VISIBLE_DEVICES.\n\n  Raises:\n      ConfigError: If the value is neither a string nor an integer.\n  \"\"\"\n  if isinstance(raw_value, bool):\n    raise ConfigError(\n        f\"cuda_visible_devices must be a string or integer, got {raw_value!r}.\"\n    )\n  if isinstance(raw_value, int):\n    return str(raw_value)\n  if isinstance(raw_value, str):\n    return raw_value\n  raise ConfigError(\n      \"cuda_visible_devices must be a string (quote it in YAML) or \"\n      f\"integer, got {raw_value!r}.\"\n  )\n\n\n# ── Public loader ───────────────────────────────────────────────────────────\n\n\ndef load_config(config_path: str) -> PipelineConfig:\n  \"\"\"Reads, validates, and returns the pipeline configuration.\n\n  All validation happens here so that every stage fails at the same gate,\n  before any dataset walk or GPU work. On success the returned object is\n  fully typed and internally consistent.\n\n  Args:\n      config_path: Path to the YAML configuration file.\n","sourceCodeStart":609,"sourceCodeEnd":645,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py#L609-L645","documentation":"Raised in _validate_cuda_visible_devices when the value is neither a string nor an integer. Only those types are acceptable for CUDA_VISIBLE_DEVICES.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:627 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a string like \"0,1\" (quote it in YAML to preserve commas) or a plain integer.","Ensure the value is not null, a list, or a float.","Example: cuda_visible_devices: \"0,1\" or cuda_visible_devices: 0."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}