1、報(bào)錯(cuò)內(nèi)容
安裝庫時(shí)報(bào)錯(cuò):
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.3'
2、檢查
查看cuda版本和pytorch版本
python 進(jìn)入python環(huán)境
import torch
torch.__version__
torch.cuda.is_available()
nvidia-smi
nvcc -V
因此發(fā)現(xiàn)是由于該虛擬環(huán)境中CUDA與torch的版本不對(duì)應(yīng),發(fā)現(xiàn)在安裝虛擬環(huán)境的environment.yml文件中只有指定cuda版本,而沒有自動(dòng)安裝正確的torch版本:
channels:
- pytorch
- conda-forge
dependencies:
- python
- cudatoolkit=11.3
3、解決
重新安裝torch,在 torch 官網(wǎng)中找到適配的版本,并安裝
pip install torch1.12.1+cu113 torchvision0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113文章來源:http://www.zghlxwxcb.cn/news/detail-519209.html
注意:盡量使用pip安裝,因?yàn)閏onda安裝后有時(shí)還是不會(huì)安裝cuda對(duì)應(yīng)版本文章來源地址http://www.zghlxwxcb.cn/news/detail-519209.html
到了這里,關(guān)于安裝庫報(bào)錯(cuò):No CUDA runtime is found, using CUDA_HOME=‘/usr/local/cuda-11.3‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!