几年前的联想游戏本,现在学习pytorch,安装过程中掉了很多坑,最后成功安装合适的版本,分享出来共老电脑老显卡的同学们参考。
整体顺序上,anaconda和cuda+cudnn先装哪个都可以
(注意:cuda+cudnn都要安装,先装cuda,再装cudnn)
1、一定要装anaconda3.5版本,因为高版本的anaconda内置的高版本的python3.9,
而高版本的python3.9会和cuda8.0对应的pytorch1.0.0 及torchvision0.2.1 都不兼容。。
anaconda和cuda这两个装好后,再安装pytorch+torchvison
2、pytorch+torchvison,要通过conda prompt使用命令:复制下面的四行代码粘贴到conda prompt,再回车
(原因:pytorch的服务器在国外,下载很慢且易失败。所以把下载源切换为清华源)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
3、安装合适的版本的pytorch + torchvision,使用如下命令:
conda install pytorch=