What is the compatible torchvision version for torch-1.14.0a0+44dac51c.nv23.2 installed on AGX ORIN( Ubuntu-22.04, JP-5.1/5.0, Python-3.8, CUDA-11.4)

I have installed torch with cuda - from the site : Installing PyTorch for Jetson Platform - NVIDIA Docs, which didn’t has a compatible torchvision version to install on ORIN with Jetpack 5.1, Ubuntu 22.04, Cuda 11.4, and Python 3.8.

  • So, from GitHub - pytorch/vision at release/0.15, when we installed torchvision version 0.15 then by default torch 2.0 is getting installed which is not enabled with CUDA and uninstalling the previously installed torch 1.14.
    Is there any way to fix this ?

And according to the mentioned ORIN setup:

  • Where could we find a compatible torchvision version for torch 1.14 compiled with cuda 11.4 on python 3.8 ?
  • Is there any suitable torch, torchvision version compiled with cuda 11.4 which is compatible with python 3.10 (default on ubuntu 22.04)?

The aim is to run object detection with YOLO on GPU.


I have torch version 1.14.0a0+44dac51c.nv23.02 and would like to know the same …

I moved your post to the Jetson Orin area - the team and community which is active here are more likely to know the answer to your question.
Best of luck with your project.

Hi @darshana, can you try building torchvision the way in PyTorch for Jetson post? (see Installation section)

The version of torchvision I used for PyTorch 2.0 in the the l4t-pytorch container was v0.14.1

@lennxdy I don’t have a container for PyTorch 1.14, but for PyTorch 1.13 I used torchvision v0.13.0

I have a similiar question with try to install torchvision on my jetson agx orin. jetpack5.1
I installed pytorch with v2.0.0, now try to install 0.15.1 torchvision.

So I run setup torchvision

sudo apt install -y libjpeg-dev zlib1g-dev
git clone --branch v0.15.1 GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision torchvision
cd torchvision
sudo python3 setup.py install `

but i got

Traceback (most recent call last):
File “setup.py”, line 9, in import torch
ModuleNotFoundError: No module named ‘torch’

I guess I have already installed torch properly

Python 3.8.10 (default, Mar 13 2023, 10:26:41)
import torch

my pip list result

torch 2.0.0a0+8aa34602.nv23.3

Hi @1696044125, I think that when you run sudo python3 setup.py install, it can’t find torch package in your virtualenv since it was ran with sudo. You could try running it without sudo, or installing torch with sudo system-wide.

same problem here, Im stuck in torch1.12 and torchvision 0.12 from jetson-inference.
please if 1.14 or 2.x is possible with a torchvision working make clear instructions, or wheels.
Jetson Orin NX JP5.1

1 Like

Hi @fpsychosis, what error are you encountering installing torchvision? Are you able to install the PyTorch 2.0 wheel and then build torchvision like this:

$ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
$ git clone --branch <version> https://github.com/pytorch/vision torchvision   # see below for version of torchvision to download
$ cd torchvision
$ export BUILD_VERSION=0.x.0  # 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

pytorch in the guide is not 2.0, it is 1.14 which is not listed in the official pytorch realeses and it has not a torchvision correspondence . Doesnt appear any wheel of torch 2.0 and if install the normal one it won’t install with CUDA.
In jetson inference install torch 1.12 and download torchvision 0.12, but wont install torchvision as the right version is 0.13 instead 0.12.
I got work torch 1.12 with torlchvision 0.13 but that config is not in any guide, the other options or are not in guide, or not install, or install without Cuda or have not torchvision correspondence. Because that I asked by clear instructions.
Also following the guides the torch version and tensorflow version will conflict due to different versions of numpy. Using numpy 1.22 would be possible install both system wide.

In my experience it’s not necessary that the PyTorch and torchvision versions strictly correspond, so sometimes with new versions it’s okay for the torchvision version to slightly lag behind the PyTorch version. Regardless the instructions from PyTorch for Jetson have still been working and installing that particular version of numpy also doesn’t seem to be necessary.

yes I did, torchvision v0.15.1 and sends error with gpu not supported 8.7.
trying 0.14.1

'same with 0.14.1, gpu not recognized

@dusty_nv I could read in your docker you used 0.14.1 with torch 2.0, how you avoided this error and compiled with GPU?

@fpsychosis try editing your /home/nrover/.local/lib/python-3.8/site-packages/torch/utils/cpp_extension.py file with these changes: https://gist.github.com/dusty-nv/ce51796085178e1f38e3c6a1663a93a1#file-pytorch-1-11-jetpack-5-0-patch

thanks , worked, would be nice include that in guides or wheels.

I’m not sure why it was needed in your case as it should have already been patched, alas it is included in PyTorch for Jetson

I just follow the documents guides.
Jetson Orin NX 16gb in Waveshare Carrier in NVME.
First installation 5.1 in NVME with sdkmanager, failed, no supported yet.
Flashed OS, and the rest of things via apt.
15 days after, release 5.1.1, update following guide, fails, known error, solution given, fails. Lost of data worked, lost everything.
Fresh install with SDK manager 5.1.1 , supported this time, but fails, doesn’t recognize Orin NX in Step 1, but the other steps recognized it, but I was being able to flash the OS the other steps failed, but I had OS so manually installed again jetpack and so.
Followed the guides for torch and tensoflow, they will conflict, followed the guide of jetson-inference, would not install pytorch by wrong target, followed the post/guide pytorch 2, failed torchvision with no gpu. Jetson Zoo guides didnt help too, they looks outdated.
Every step I did was following guides.

The flashing issues you encountered with the Waveshare carrier I can’t comment on, and would recommend opening new topics about those if they continue being an issue for you. On JetPack 5, jetson-inference is still setup to use PyTorch v1.12 as that is fine for it (it doesn’t need the latest/greatest always and I prefer using a stable and well-tested version of PyTorch for the Hello AI World tutorial in jetson-inference). However there are l4t-pytorch and l4t-ml containers that are built with newer versions of PyTorch.

Hi, dusty
the torch-2.0-nv23.03 wheel still not patched with sm8.7 support, and torch2.0-nv23.04 wheel mentioned on pytorch on jetson is not available

Hi @user103181, you can manually apply the patch from this comment to your local installation:

Or you can try out this updated wheel: torch-2.0.0.nv23.05-cp38-cp38-linux_aarch64.whl

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