Skip to content

Instantly share code, notes, and snippets.

@25b3nk
Last active November 5, 2018 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 25b3nk/4b2fc6cb3f51dbf5bb24cf887f4f5729 to your computer and use it in GitHub Desktop.
Save 25b3nk/4b2fc6cb3f51dbf5bb24cf887f4f5729 to your computer and use it in GitHub Desktop.
Installing PyTorch on Jetson-TX2 for Python2.7
# First of all install python pip
sudo apt-get install python-pip
# Upgrading pip using `pip install -U pip` gave me errors after,
# so I will be avoiding that.
# Clone pytorch repo
git clone http://github.com/pytorch/pytorch
# Enter the folder
cd pytorch/
# Checkout to v0.4.0 (Version I want)
git checkout -b v0.4.0 v0.4.0
# Get the required submodules
git submodule update --init
# install prereqs
sudo pip install -U setuptools
sudo pip install -r requirements.txt
# Set environment variables
export CUDNN_LIB_DIR=/usr/lib/aarch64-linux-gnu
export CUDNN_INCLUDE_DIR=/usr/include
export CUDA_HOME=/usr/local/cuda # Provide path where CUDA is present
# Install PyTorch
sudo python setup.py install # Pytorch
sudo pip install torchvision # Torchvision package that supports the PyTorch library
# Testing if PyTorch with GPU is installed
# import torch
# print(torch.__version__)
## Out: 0.4.0a0+3749c58
# print(torch.cuda.is_available())
## Out: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment