To Top
首页 > 基础知识 > 正文

pytorch安装

标签:pytorch安装


目录

参考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

首先需要

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

非conda

../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"

原创文章,转载请注明出处!
本文链接:http://daiwk.github.io/posts/knowledge-pytorch-install.html
上篇: python小技巧
下篇: rnn实现

comment here..