1检查cuda版本
pytorch版本需要跟cuda对应
输入命令:cat /usr/local/cuda/version.txt
我的cuda是9.0
2.pytorch官网下载
根据cuda版本,pytorch官网,下载对应的版本。复制最后一行语句。
<img =‘https://i-blog.csdnimg.cn/blog_migrate/f086138f8cd036718ee83af79e8ab268.png’ width=70%>
3安装
输入命令conda install pytorch==1.1.0 torchvision ==0.3.0 cudatoolkit=9.0 -c pytorch
点击y确认安装