星期日, 3月 27, 2022

How to install pytorch in tx2

 

 nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2021 NVIDIA Corporation

Built on Sun_Feb_28_22:34:44_PST_2021

Cuda compilation tools, release 10.2, V10.2.300

Build cuda_10.2_r440.TC440_70.29663091_0


cuda_10.2
python3.6

PyTorch for Jetson - version 1.10 now available

  • PyTorch v1.7 - torchvision v0.8.1

Install jetson pytorch: 
https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-10-now-available/72048

--------------------------
pytorch
wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.10.0-cp36-cp36m-linux_aarch64.whl sudo apt-get install python3-pip libopenblas-base libopenmpi-dev pip3 install Cython  pip3 install torch-1.7.0-cp36-cp36m-linux_aarch64.whl

---------------------
$sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev$
$git clone --branch v0.12.0 https://github.com/pytorch/vision torchvision # see below for version of torchvision to download
$ cd torchvision $ export BUILD_VERSION=0.8.1 # where 0.x.0 is the torchvision version $ python3 setup.py install --user
$ cd ../ # attempting to load torchvision from build dir will result in import error
$pip install 'pillow<7' # always needed for Python 2.7, not needed torchvision v0.5.0+ with Python 3.6

------------------

sudo apt-cache show nvidia-jetpack
It will show something like:

Package: nvidia-jetpack
Version: 4.4-b144
Architecture: arm64
Maintainer: NVIDIA Corporation

-------------------------------------

cuda version

$ cat /usr/local/cuda/version.txt

CUDA Version 10.2.300

-----------------------------------------

查看cudnn版本

ls /usr/local/cuda*
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2-------------------------------------workable pytorch in TX2 w/ python3.6 CUDA 10.2, jetpack 4.4https://developer.nvidia.com/embedded/downloads
----------------------------------

pip3 install --no-deps torchvision Collecting torchvision Using cached https://files.pythonhosted.org/packages/fb/01/03fd7e503c16b3dc262483e5555ad40974ab5da8b9879e164b56c1f4ef6f/torchvision-0.2.2.post3-py2.py3-none-any.whl Installing collected packages: torchvision Successfully installed torchvision-0.2.2.post3



沒有留言: