当前位置:网站首页>AssertionError: CUDA unavailable, invalid device 0 requested

AssertionError: CUDA unavailable, invalid device 0 requested

2022-06-25 01:34:00 Little markk

In the use of yolov5 During training , Prompt this error , see torch.cuda.is_available() The return value is false

see nvidia-smi Information can be seen

Due to previous use conda Installed torch1.9.0

Use here pip reinstall :

pip3 install torch == 1.9.0+cu111 torchvision == 0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

After installation , Re execution torch.cuda.is_available() when

You can see the correct result

Reference resources :AssertionError: CUDA unavailable, invalid device 0 requested_ eliminate BUG Duck blog -CSDN Blog _cuda unavailable

原网站

版权声明
本文为[Little markk]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206242119196994.html