基于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
內(nèi)容為
channels:
? - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
? - defaults
show_channel_urls: true
去pytorch官網(wǎng)查看安裝命令,python 3.6 cpu版命令如下
conda install pytorch-cpu torchvision-cpu -c pytorch
安裝完成之后輸入python,然后import torch進行測試
