指令
conda install pytorch=0.3.1 torchvision cuda90 -c pytorch
注意事项:
1 pytorch=0.3.1 (0.3.1 改为你要安装的pytorch版本) 查看pytorch版本号点我
2 cuda90 改为你自己的cuda版本
在安装pytorch时有时候会报错,其中出现”CondaHTTPError: HTTP None None for url…..”这类错误时
基本是因为有些库需要外网才能下载,所以我们需要使用conda的清华镜像。
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
然后再运行
conda install pytorch=0.3.1 torchvision cuda90 -c pytorch
参考文章
加油 2018.10.1