-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
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
AssertionError: CUDA unavailable, invalid device 0 requested #474
Comments
Hello @yancccc, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook , Docker Image, and Google Cloud Quickstart Guide for example environments. 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 model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com. |
Check that you have CUDA installed |
|
ycc@ycc:~/yolov5-master$ nvcc -V |
@yancccc it appears you have environment problems. In order to run YOLOv5 correctly your environment must meet the minimum version requirements for the dependencies described in https://github.com/ultralytics/yolov5#requirements. You can either update your local environment to bring it into compliance or you can use one of our verified environment options below. Reproduce Our EnvironmentYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
|
@yancccc do you solve the problem ? i meet the same problem |
I meet the same problem. I used: got |
maybe you can try |
@Myhuang1996 's solution solved the issue in my case! |
try the latest pytorch + correct version of cuda: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Pytorch1.6 supports CUDA 9.2, 10.1 and 10.2. I update the version of CUDA,yolov5 can work. |
PS D:\Kuliah\Yolov5\yolov5-master> nvcc -V i used cuda 11.6 what version torch and torchvision must im install? |
Throwing this error now. Error:
@Myhuang1996 facing the same issue. I tried your solution as well. |
@shubhambagwari you are not meeting requirements and your machine is not online for auto-update to work |
~/yolov5-master$ python detect.py --source ./inference/images/ --weights yolov5s.pt --conf 0.4 --device 0
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='0', img_size=640, iou_thres=0.5, output='inference/output', save_txt=False, source='./inference/images/', update=False, view_img=False, weights=['yolov5s.pt'])
False
Traceback (most recent call last):
File "detect.py", line 161, in
detect()
File "detect.py", line 16, in detect
device = torch_utils.select_device(opt.device)
File "/home/ycc/yolov5-master/utils/torch_utils.py", line 33, in select_device
assert torch.cuda.is_available(), 'CUDA unavailable, invalid device %s requested' % device # check availablity
AssertionError: CUDA unavailable, invalid device 0 requested
The text was updated successfully, but these errors were encountered: