Code: Select all
# Install dependency
pip install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses
# Download pytorch source code
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
# If you are updating an existing checkout
git submodule sync
git submodule update --init --recursive --jobs 0
# Build
# If you want to use pytorch with cuda, please `USE_CUDA=1`
python setup.py install
# Install torchvision from source
git clone --recursive --branch v0.11.1 https://github.com/pytorch/vision.git
cd vision
python setup.py install