{"record":{"id":"3dc38b0fb0d352e3","repo":"tensorflow/models","slug":"config-file-must-contain-a-top-level-mapping-of-se","errorCode":null,"errorMessage":"Config file must contain a top-level mapping of settings.","messagePattern":"Config file must contain a top-level mapping of settings\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py","lineNumber":666,"sourceCode":"\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\n  input_images_folder_name = _require_allowed_folder_name(\n      raw_config[\"input_images_folder_name\"], \"input_images_folder_name\"\n  )\n  train_val_folder_name = _require_allowed_folder_name(\n      raw_config[\"train_val_folder_name\"], \"train_val_folder_name\"","sourceCodeStart":648,"sourceCodeEnd":684,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py#L648-L684","documentation":"Error \"Config file must contain a top-level mapping of settings.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:666 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"}