{"record":{"id":"a285f7e8351c476d","repo":"WZMIAOMIAO/deep-learning-for-image-processing","slug":"drive-dose-not-in-path","errorCode":null,"errorMessage":"DRIVE dose not in path:'{}'.","messagePattern":"DRIVE dose not in path:'(.+?)'\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pytorch_segmentation/unet/train_multi_GPU.py","lineNumber":78,"sourceCode":"\ndef main(args):\n    init_distributed_mode(args)\n    print(args)\n\n    device = torch.device(args.device)\n    # segmentation nun_classes + background\n    num_classes = args.num_classes + 1\n\n    mean = (0.709, 0.381, 0.224)\n    std = (0.127, 0.079, 0.043)\n\n    # 用来保存coco_info的文件\n    results_file = \"results{}.txt\".format(datetime.datetime.now().strftime(\"%Y%m%d-%H%M%S\"))\n\n    data_root = args.data_path\n    # check data root\n    if os.path.exists(os.path.join(data_root, \"DRIVE\")) is False:\n        raise FileNotFoundError(\"DRIVE dose not in path:'{}'.\".format(data_root))\n\n    train_dataset = DriveDataset(args.data_path,\n                                 train=True,\n                                 transforms=get_transform(train=True, mean=mean, std=std))\n\n    val_dataset = DriveDataset(args.data_path,\n                               train=False,\n                               transforms=get_transform(train=False, mean=mean, std=std))\n\n    print(\"Creating data loaders\")\n    if args.distributed:\n        train_sampler = torch.utils.data.distributed.DistributedSampler(train_dataset)\n        test_sampler = torch.utils.data.distributed.DistributedSampler(val_dataset)\n    else:\n        train_sampler = torch.utils.data.RandomSampler(train_dataset)\n        test_sampler = torch.utils.data.SequentialSampler(val_dataset)\n\n    train_data_loader = torch.utils.data.DataLoader(","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/WZMIAOMIAO/deep-learning-for-image-processing/blob/1ec3fe6f374fc9969973a61f819de25658595afa/pytorch_segmentation/unet/train_multi_GPU.py#L60-L96","documentation":"train_multi_GPU.py validates that the DRIVE directory exists directly under args.data_path before building datasets, raising FileNotFoundError('DRIVE dose not in path:...') otherwise. It fails fast instead of letting the dataset constructor fail later with a less obvious message.","triggerScenarios":"Running multi-GPU training with --data-path pointing at a directory that does not contain a DRIVE/ subfolder (e.g. pointing at DRIVE itself rather than its parent, or a typo'd path).","commonSituations":"Passing .../DRIVE instead of .../ as data-path, dataset extracted to a different location than the arg, relative path resolved from the wrong working directory, or misspelled folder name (drive/Drive).","solutions":["Set --data-path to the parent directory CONTAINING the DRIVE folder, e.g. --data-path /data (with /data/DRIVE/... inside)","Verify with ls $DATA_PATH/DRIVE before launching","Check folder case sensitivity (DRIVE vs drive) on Linux"],"exampleFix":"// before\npython train_multi_GPU.py --data-path /data/DRIVE\n// after\npython train_multi_GPU.py --data-path /data   # /data/DRIVE must exist","handlingStrategy":"validation","validationCode":"import os\nassert os.path.isdir(os.path.join(args.data_path, \"DRIVE\")), \\\n    f\"DRIVE folder not found under {args.data_path} — pass the parent directory\"","typeGuard":"def drive_root_ok(data_path: str) -> bool:\n    return os.path.isdir(os.path.join(data_path, \"DRIVE\"))","tryCatchPattern":"try:\n    main(args)\nexcept FileNotFoundError as e:\n    print(f\"fix --data-path: {e}\"); raise SystemExit(1)","preventionTips":["--data-path must be the PARENT of DRIVE, not DRIVE itself","Run `ls $DATA_PATH/DRIVE` before launching multi-GPU training","Watch Linux case sensitivity: DRIVE vs drive"],"tags":["python","file-not-found","dataset","multi-gpu"],"backgroundTag":"missing-env-var","analyzedSha":"1ec3fe6f374fc9969973a61f819de25658595afa","analyzedAt":"2026-08-30T09:19:11.901Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}