-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[solve]Exception: path is on mount 'C:', start on mount 'D:'. Cache may be out of date, #6976
Comments
👋 Hello @polarbear0827, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://ultralytics.com or email [email protected]. RequirementsPython>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
I have the same problem as you. The possible reason for this error is the |
Is it changed to this? model = torch.hub.load("C:/Users/USER/.cache/torch/hub/ultralytics_yolov5_master", "custom", path = "D:/Users/a5201/olococogpu01/yolov5/runs/train/exp34/weights/best.pt", force_reload=True ) |
it produces another error D:\Users\a5201\yolococogpu01\venv\Scripts\python.exe D:/Users/a5201/yolococogpu01/detect01.py |
I haven't tried it. I cloned yolov5 repo and it works. |
remember "source=local" |
i'd like to apologize for my forgot that, but it still error model = torch.hub.load("C:/Users/USER/.cache/torch/hub/ultralytics_yolov5_master", "custom", path = "D:/Users/a5201/olococogpu01/yolov5/runs/train/exp34/weights/best.pt", source='local' ) fatal: not a git repository (or any of the parent directories): .git Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): Process finished with exit code 1 |
Lets try clone yolov5 repo and copy path. It works for me |
I clone yolov5 and the problem still occurs |
Move entire file to C folder, It can be solved |
In general, allocate a directory on Disk C to be used as the running directory of the API site, and then copy restapi.py to solve the problem. |
@polarbear0827 @quangdungluong @CHENZHIKANG I have a proposed fix PR implemented in #7158. Can you please test the PR with this command? If it works I'll merge into master, if it doesn't work please paste your new error message. Thanks! import torch
model = torch.hub.load('ultralytics/yolov5:fix/relpath', 'yolov5s', force_reload=True) |
Search before asking
YOLOv5 Component
Detection
Bug
D:\Users\a5201\yolococogpu01\venv\Scripts\python.exe D:/Users/a5201/yolococogpu01/detect01.py
Downloading: "https://github.com/ultralytics/yolov5/archive/master.zip" to C:\Users\USER/.cache\torch\hub\master.zip
fatal: not a git repository (or any of the parent directories): .git
YOLOv5 2022-3-14 torch 1.8.2+cu111 CUDA:0 (NVIDIA GeForce GTX 950M, 2048MiB)
Traceback (most recent call last):
File "C:\Users\USER/.cache\torch\hub\ultralytics_yolov5_master\hubconf.py", line 46, in _create
model = DetectMultiBackend(path, device=device) # download/load FP32 model
File "C:\Users\USER/.cache\torch\hub\ultralytics_yolov5_master\models\common.py", line 297, in init
pt, jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs = self.model_type(w) # get backend
File "C:\Users\USER/.cache\torch\hub\ultralytics_yolov5_master\models\common.py", line 475, in model_type
from export import export_formats
File "C:\Users\USER/.cache\torch\hub\ultralytics_yolov5_master\export.py", line 64, in
ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\ntpath.py", line 703, in relpath
raise ValueError("path is on mount %r, start on mount %r" % (
ValueError: path is on mount 'C:', start on mount 'D:'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Users\a5201\yolococogpu01\detect01.py", line 5, in
model = torch.hub.load("ultralytics/yolov5", "custom", path = "yolov5/runs/train/exp34/weights/best.pt", force_reload=True ).autoshape()
File "D:\Users\a5201\yolococogpu01\venv\lib\site-packages\torch\hub.py", line 339, in load
model = _load_local(repo_or_dir, model, *args, **kwargs)
File "D:\Users\a5201\yolococogpu01\venv\lib\site-packages\torch\hub.py", line 368, in _load_local
model = entry(*args, **kwargs)
File "C:\Users\USER/.cache\torch\hub\ultralytics_yolov5_master\hubconf.py", line 70, in custom
return _create(path, autoshape=autoshape, verbose=verbose, device=device)
File "C:\Users\USER/.cache\torch\hub\ultralytics_yolov5_master\hubconf.py", line 65, in _create
raise Exception(s) from e
Exception: path is on mount 'C:', start on mount 'D:'. Cache may be out of date, try
force_reload=True
or see #36 for help.Process finished with exit code 1
Environment
YOLOv5 2022-3-14 torch 1.8.2+cu111 CUDA:0 (NVIDIA GeForce GTX 950M, 2048MiB)
Python3.9
Minimal Reproducible Example
No response
Additional
code:
import torch
import cv2
import numpy as np
model = torch.hub.load("ultralytics/yolov5", "custom", path = "yolov5/runs/train/exp34/weights/best.pt", force_reload=True )
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: