具体步骤如下:
1、安装miniconda:download
$sh Miniconda3-latest-Linux-x86_64.sh
安装过程逐步输入:yes;安装路径;no(最好自己手动将安装的路径bin添加到环境变量./bashrc中)
2、创建pytorch环境:
$conda create -n pytorch0.4.1_py36 python=3.6
3、查看环境:
$conda info -e
4、激活环境:
$source activate pytorch0.4.1_py36
5、安装pytorch0.4.1:
$conda install pytorch=0.4.1 torchvision -c pytorch
或
$pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
$pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torchvision
6、其他库的几种安装方式:
a.有requirements.txt文件时:
$pip install -r requirements.txt
b.清华源:
$pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xxx
c.conda:
$conda install xxx
d.上面均无效时:
$conda install -c menpo xxx