已经过时,可以参考官网自行安装https://pytorch.org/
需要注明,官网稳定版本安装在https://pytorch.org/get-started/locally/
之前的版本在
https://pytorch.org/get-started/previous-versions/
https://download.pytorch.org/whl/torch_stable.html
(更新于2019年5月7日)
====================================================================================
参考:https://github.com/pytorch/pytorch#installation
首先安装anaconda
官方网址https://www.continuum.io/downloads
一:安装anaconda
我安装的是python2.7,64位
https://repo.continuum.io/archive/Anaconda2-4.3.1-Linux-x86_64.sh
bash Anaconda2-4.3.1-Linux-x86_64.sh
source ~/.bashrc
二:安装pytorch
gedit ~/.bashrc
然后加入:
export CMAKE_PREFIX_PATH=/home/s/anaconda2/bin
接下来安装部分依赖库:
# Install basic dependencies
conda install numpy mkl setuptools cmake gcc cffi
# Add LAPACK support for the GPU
conda install -c soumith magma-cuda75 # or magma-cuda80 if CUDA 8.0
下载pytorch的源码包:https://github.com/pytorch/pytorch/archive/master.zip
cd /home/s/tool/pytorch/pytorch-master
pip install -r requirements.txt
python setup.py install