{"record":{"id":"0dc2ecb6fcdfff1a","repo":"tensorflow/models","slug":"cannot-read-config-file-error","errorCode":null,"errorMessage":"Cannot read config file: {error}","messagePattern":"Cannot read config file: (.+?)","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py","lineNumber":661,"sourceCode":"  Args:\n      config_path: Path to the YAML configuration file.\n\n  Returns:\n      A validated :class:`PipelineConfig`.\n\n  Raises:\n      ConfigError: If the file is missing, is not valid YAML, is missing\n          required fields, contains out-of-range values, or names a\n          ``prompt_to_detect`` that has no block under ``prompts``.\n  \"\"\"\n  if not os.path.isfile(config_path):\n    raise ConfigError(f\"Config file does not exist: {config_path}\")\n\n  try:\n    with open(config_path, \"r\", encoding=\"utf-8\") as config_file:\n      raw_config = yaml.safe_load(config_file)\n  except OSError as error:\n    raise ConfigError(f\"Cannot read config file: {error}\") from error\n  except yaml.YAMLError as error:\n    raise ConfigError(f\"Config file is not valid YAML: {error}\") from error\n\n  if not isinstance(raw_config, dict):\n    raise ConfigError(\n        \"Config file must contain a top-level mapping of settings.\"\n    )\n\n  _require_keys(raw_config, _REQUIRED_TOP_LEVEL_KEYS, \"config.yaml\")\n\n  root_dir = _require_non_empty_string(raw_config[\"root_dir\"], \"root_dir\")\n  sam3_checkpoint_path = _require_non_empty_string(\n      raw_config[\"sam3_checkpoint_path\"], \"sam3_checkpoint_path\"\n  )\n  cuda_visible_devices = _validate_cuda_visible_devices(\n      raw_config[\"cuda_visible_devices\"]\n  )\n","sourceCodeStart":643,"sourceCodeEnd":679,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py#L643-L679","documentation":"Error \"Cannot read config file: {error}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:661 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}