1 前言
在配置rtx3090运行环境的时,反复报错说环境冲突,我把主页各种版本都尝试了一次,都失败了。暂时没找到什么原因。
最后在网页上找到这位网友的经验,居然成功了,感谢这位网友的分享。
2 前期应用软件安装
前期应用软件的安装在此不做赘述,有很多网友都分享了非常详细的安装步骤,有不熟悉的网友可以参考这篇文章,这为网友非常nice,手把手教学。
3 正文
环境配置完之后,在自己的命令行键入如下命令:
pip install torch===1.7.1+cu110 torchvision===0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
安装日志如下:
(torch) C:\Users\Admin>pip install torch===1.7.1+cu110 torchvision===0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch===1.7.1+cu110
Downloading https://download.pytorch.org/whl/cu110/torch-1.7.1%2Bcu110-cp38-cp38-win_amd64.whl (2050.2 MB)
---------------------------------------- 2.1/2.1 GB 1.4 MB/s eta 0:00:00
Collecting torchvision===0.8.2+cu110
Downloading https://download.pytorch.org/whl/cu110/torchvision-0.8.2%2Bcu110-cp38-cp38-win_amd64.whl (1.6 MB)
---------------------------------------- 1.6/1.6 MB 4.7 MB/s eta 0:00:00
Collecting torchaudio===0.7.2
Downloading https://download.pytorch.org/whl/torchaudio-0.7.2-cp38-none-win_amd64.whl (103 kB)
---------------------------------------- 104.0/104.0 kB 669.5 kB/s eta 0:00:00
Requirement already satisfied: typing-extensions in d:\anaconda3\envs\torch\lib\site-packages (from torch===1.7.1+cu110) (4.4.0)
Requirement already satisfied: numpy in d:\anaconda3\envs\torch\lib\site-packages (from torch===1.7.1+cu110) (1.23.5)
Requirement already satisfied: pillow>=4.1.1 in d:\anaconda3\envs\torch\lib\site-packages (from torchvision===0.8.2+cu110) (9.3.0)
Installing collected packages: torch, torchvision, torchaudio
Attempting uninstall: torch
Found existing installation: torch 1.9.0
Uninstalling torch-1.9.0:
Successfully uninstalled torch-1.9.0
Attempting uninstall: torchvision
Found existing installation: torchvision 0.10.0
Uninstalling torchvision-0.10.0:
Successfully uninstalled torchvision-0.10.0
Attempting uninstall: torchaudio
Found existing installation: torchaudio 0.9.0
Uninstalling torchaudio-0.9.0:
Successfully uninstalled torchaudio-0.9.0
Successfully installed torch-1.7.1+cu110 torchaudio-0.7.2 torchvision-0.8.2+cu110
最后进入python环境测试:
import torch
torch.cuda.is_available()
torch.backends.cudnn.is_available()
torch.cuda_version)
torch.backends.cudnn.version()
测试结果:
4 注意点
1 英伟达30系显卡需要cuda的版本为11.0及以上版本