{"record":{"id":"cdfa414017522028","repo":"tensorflow/models","slug":"root-directory-does-not-exist-root-dir","errorCode":null,"errorMessage":"Root directory does not exist: {root_dir}","messagePattern":"Root directory does not exist: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/filter_sparse_images.py","lineNumber":160,"sourceCode":"\n# ── Dataset discovery and validation ──────────────────────────────────────────\n\n\ndef discover_dataset_directories(root_dir: str) -> list[tuple[str, str]]:\n  \"\"\"Returns the list of dataset subdirectories directly under ``root_dir``.\n\n  Args:\n      root_dir: Path to the root directory containing dataset subfolders.\n\n  Returns:\n      A sorted list of ``(dataset_name, dataset_path)`` tuples.\n\n  Raises:\n      FileNotFoundError: If ``root_dir`` does not exist.\n      ValueError: If ``root_dir`` contains no subdirectories.\n  \"\"\"\n  if not os.path.isdir(root_dir):\n    raise FileNotFoundError(f\"Root directory does not exist: {root_dir}\")\n\n  dataset_entries = sorted(\n      [entry for entry in os.scandir(root_dir) if entry.is_dir()],\n      key=lambda entry: entry.name,\n  )\n\n  if not dataset_entries:\n    raise ValueError(f\"No dataset subfolders found under: {root_dir}\")\n\n  return [(entry.name, entry.path) for entry in dataset_entries]\n\n\ndef validate_dataset_paths(\n    dataset_directories: list[tuple[str, str]], input_images_folder_name: str\n) -> list[tuple[str, str]]:\n  \"\"\"Validates that each dataset has the expected input images folder.\n\n  Args:","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/filter_sparse_images.py#L142-L178","documentation":"Error \"Root directory does not exist: {root_dir}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/filter_sparse_images.py:160 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"}