{"record":{"id":"2570bed595490be8","repo":"ultralytics/yolov5","slug":"no-yaml-definition-found-in-dataset-root-path-che","errorCode":null,"errorMessage":"No yaml definition found in dataset root path, check that there is a correct yaml file inside the dataset root path.","messagePattern":"No yaml definition found in dataset root path, check that there is a correct yaml file inside the dataset root path\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"utils/loggers/clearml/clearml_utils.py","lineNumber":55,"sourceCode":"class ClearmlNotConfiguredError(ValueError):\n    \"\"\"Raised when ClearML is installed but not configured for task logging.\"\"\"\n\n\ndef construct_dataset(clearml_info_string):\n    \"\"\"Load in a clearml dataset and fill the internal data_dict with its contents.\"\"\"\n    dataset_id = clearml_info_string.replace(\"clearml://\", \"\")\n    dataset = Dataset.get(dataset_id=dataset_id)\n    dataset_root_path = Path(dataset.get_local_copy())\n\n    # We'll search for the yaml file definition in the dataset\n    yaml_filenames = list(glob.glob(str(dataset_root_path / \"*.yaml\")) + glob.glob(str(dataset_root_path / \"*.yml\")))\n    if len(yaml_filenames) > 1:\n        raise ValueError(\n            \"More than one yaml file was found in the dataset root, cannot determine which one contains \"\n            \"the dataset definition this way.\"\n        )\n    elif not yaml_filenames:\n        raise ValueError(\n            \"No yaml definition found in dataset root path, check that there is a correct yaml file \"\n            \"inside the dataset root path.\"\n        )\n    with open(yaml_filenames[0]) as f:\n        dataset_definition = yaml.safe_load(f)\n\n    assert set(dataset_definition.keys()).issuperset({\"train\", \"test\", \"val\", \"nc\", \"names\"}), (\n        \"The right keys were not found in the yaml file, make sure it at least has the following keys: ('train', 'test', 'val', 'nc', 'names')\"\n    )\n\n    data_dict = {\n        \"train\": (\n            str((dataset_root_path / dataset_definition[\"train\"]).resolve()) if dataset_definition[\"train\"] else None\n        )\n    }\n    data_dict[\"test\"] = (\n        str((dataset_root_path / dataset_definition[\"test\"]).resolve()) if dataset_definition[\"test\"] else None\n    )","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/ultralytics/yolov5/blob/20d1d78a08277e365d57bfa3a2cce752772d9e59/utils/loggers/clearml/clearml_utils.py#L37-L73","documentation":"clearml_utils.construct_dataset raises ValueError when the downloaded ClearML dataset root contains zero .yaml or .yml files. The clearml:// loading protocol depends on finding a dataset definition yaml inside the local copy; if the dataset was created without one (e.g. only images were uploaded), there is nothing to derive train/val paths from and the load aborts.","triggerScenarios":"Passing data='clearml://<id>' for a dataset whose upload folder had the yaml excluded or nested in a subdirectory (glob only checks the root); uploading raw images with clearml-data add without adding data.yaml; the yaml named with an unrecognized extension (e.g. .yam).","commonSituations":"First attempts at ClearML integration; packaging scripts that filter out yaml files; datasets created from a parent folder while the yaml sat one level down.","solutions":["Add a valid dataset yaml (with train/test/val/nc/names keys) to the ClearML dataset root and bump the version.","Ensure the yaml is at the top level of the uploaded folder, not nested, and named .yaml or .yml.","Alternatively skip clearml:// and pass a local yaml whose paths point at a manually fetched dataset copy."],"exampleFix":"# before: dataset uploaded with images only -> 'No yaml definition found'\n# after\nclearml-data add --files clean_root/data.yaml  # plus images, yaml at root\nclearml-data upload\npython train.py --data clearml://<new_dataset_id> ...","handlingStrategy":"validation","validationCode":"from pathlib import Path\nimport glob as _glob\n\ndef clearml_yaml_present(root: str) -> bool:\n    return bool(_glob.glob(str(Path(root) / '*.yaml')) + _glob.glob(str(Path(root) / '*.yml')))","typeGuard":null,"tryCatchPattern":"try:\n    data_dict = construct_dataset(f'clearml://{dataset_id}')\nexcept ValueError as e:\n    if 'No yaml definition found' in str(e):\n        raise SystemExit('add a data.yaml with train/val/test/nc/names to the dataset root and re-upload') from e","preventionTips":["Include the dataset yaml in the clearml-data upload from the start.","Verify the local dataset copy (get_local_copy) layout before referencing clearml:// ids."],"tags":["clearml","dataset","config","missing-files"],"backgroundTag":null,"analyzedSha":"20d1d78a08277e365d57bfa3a2cce752772d9e59","analyzedAt":"2026-08-15T02:56:15.443Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}