目录
参考https://github.com/pytorch/pytorch#from-source
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
首先需要3.5以上的cmake:https://cmake.org/download/,例如https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz
然后
./bootstrap --prefix=/home/work/xxx
make
make install
首先需要
conda install numpy pyyaml mkl mkl-include setuptools cmake cffi typing
然后在linux上的话:
# Add LAPACK support for the GPU if needed
conda install -c pytorch magma-cuda90 # or [magma-cuda80 | magma-cuda92 | magma-cuda100 ] depending on your cuda version
然后安装
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
python setup.py install
../python-2.7.14-tf-2.0/bin/python ../python-2.7.14-tf-2.0/bin/pip install pyyaml mkl mkl-include setuptools cmake cffi typing
./xxx/bin/python ./xxx/bin/pip install torch
/opt/compiler/gcc-4.8.2/lib/ld-linux-x86-64.so.2 --library-path /opt/compiler/gcc-4.8.2/lib ./xxx/bin/python -c "import torch"