Pytorch安装(2019年8月13日)
之前安装好的pytorch1.0.1环境被我一不小心给弄坏了,整整让我纠结了一天的pytorch安装,终于能在GPU上跑通了!于是想记录一下,顺便告诉还在为此纠结发愁的小伙伴们我的安装过程,当作借鉴。
题目之所以标注了时间,是因为!在这个时间清华的镜像中无法下载pytorch1.0.1的cuda版本,而从官网上下载安装实在是太久了,还总是time out。
这次成功安装的是pytorch1.2.0+cu92。
首先要添加镜像:
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 --set show_channel_urls yes
然后要添加pytorch的镜像:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
用pip而不是conda命令:
conda install pytorch torchvision cudatoolkit=10.0
参考链接:https://blog.youkuaiyun.com/WannaSeaU/article/details/88427010