2021-02-24使用豆瓣镜像源安装pytorch和对应版本的torchvision
pytorch与torchvision版本最新对应表
创建虚拟环境
conda create -n torch1.8 python=3.8
激活虚拟环境
conda activate torch1.8
进入conda官网,选中版本
官网地址:https://pytorch.org/get-started/previous-versions/
注意:
(0)如何选择版本,官网的下载命令中torch版本和cuda版本已经对应好,只需要找到电脑合适的cuda版本
(1)选择与电脑cudnn版本匹配的版本,安装的cuda版本不高于本电脑的cuda版本
直接在搜索框中搜索 NVIDIA控制面板查看
如何查看电脑cudnn版本,参考:
查看系统cuda
(2)官网下载的命令选择带有torchvison版本的,没有带该版本,最后下载下来的torchvison会版本过低(不要安装最新的
版本,没有带torchvision)
因此
选择了torch1.8 的cuddn11安装命令
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge