ubuntu 16.04安装pytorch

2019-03-12  本文已影响0人  ccccxxxxcccc

基于conda安装,pyhon3.6 cpu版

修改conda镜像源为清华大学的源

conda config --prepend channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

查看是否修改成功,首先运行如下命令

conda config --set show_channel_urls yes

会生成一个condarc的文件可以查看

cat ~/.condarc

内容为

channels:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

  - defaults

show_channel_urls: true

去pytorch官网查看安装命令,python 3.6 cpu版命令如下

conda install pytorch-cpu torchvision-cpu -c pytorch

安装完成之后输入python,然后import torch进行测试

上一篇 下一篇

猜你喜欢

热点阅读