Install Pytorch from source under Ubuntu

Install Pytorch from source under Ubuntu


Environmental preparation

  1. Install CUDA, download address NVIDIA official website , install tutorial recommended blog
  2. Install Anaconda python environment
    export CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" # [anaconda root directory]

    # Install basic dependencies
    conda install numpy pyyaml mkl mkl-include setuptools cmake cffi typing

    # Add LAPACK support for the GPU
    conda install -c pytorch magma-cuda80 # or magma-cuda90 if CUDA 9
  1. Download the source code and install it
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325521464&siteId=291194637