A versionof pytorch different from the installed is imported. How can I use a given version of pytorch?

I have set up Orin as follows

$ sudo bash -c 'echo "deb https://repo.download.nvidia.com/jetson/common r34.1 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list'
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install nvidia-jetpack
$ sudo apt-get -y install autoconf bc build-essential g++-8 gcc-8 clang-8 lld-8 gettext-base gfortran-8 iputils-ping libbz2-dev libc++-dev libcgal-dev libffi-dev libfreetype6-dev libhdf5-dev libjpeg-dev liblzma-dev libncurses5-dev libncursesw5-dev libpng-dev libreadline-dev libssl-dev libsqlite3-dev libxml2-dev libxslt-dev locales moreutils openssl python-openssl rsync scons python3-pip libopenblas-dev;
$ export TORCH_INSTALL=https://developer.download.nvidia.com/compute/redist/jp/v50/pytorch/torch-1.13.0a0+340c4120.nv22.06-cp38-cp38-linux_aarch64.whl
$ python3 -m pip install --upgrade pip; python3 -m pip install aiohttp numpy=='1.19.4' scipy=='1.5.3' export "LD_LIBRARY_PATH=/usr/lib/llvm-8/lib:$LD_LIBRARY_PATH"; python3 -m pip install --upgrade protobuf; python3 -m pip install --no-cache $TORCH_INSTALL

Orin’s environment is as follows

$ cat /etc/nv_tegra_release
# R34 (release), REVISION: 1.1, GCID: 30414990, BOARD: t186ref, EABI: aarch64, DATE: Tue May 17 04:20:55 UTC 2022

$ apt show nvidia-jetpack
Package: nvidia-jetpack
Version: 5.0.1-b118
Priority: standard
Section: metapackages
Maintainer: NVIDIA Corporation
Installed-Size: 199 kB
Depends: nvidia-jetpack-runtime (= 5.0.1-b118), nvidia-jetpack-dev (= 5.0.1-b118)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 29.3 kB
APT-Manual-Installed: yes
APT-Sources: https://repo.download.nvidia.com/jetson/t234 r34.1/main arm64 Packages
Description: NVIDIA Jetpack Meta Package

pip show command appears to correctly install the given version of pytorch.

$ pip show torch
Name: torch
Version: 1.13.0a0+340c4120.nv22.6
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: /home/rslab-orin1/.local/lib/python3.8/site-packages
Requires: typing-extensions
Required-by: 

But python imports different version of pytorch

$ python3
Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.12.0a0+02fb0b0f.nv22.06

How can I use a given version of pytorch? Thanks.

Sorry for the late response, is this still an issue to support? Thanks

Hi,

The simplest approach is to remove PyTorch 1.12.

More, it looks like you are using JetPack 5.0.1, a DP package.
It’s recommended to move to our GA release, like 5.0.2 or 5.1.

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.