No compatible version of (torchvision) package for latest PyTorch for Jetson AGX Xaviera

Hi, I’ve encountered an issue when trying to deploy a custom NN with PyTorch on Jetson AGX Xavier (Developer Kit 32 GB, JetPack 5.1).

I’ve downloaded the latest official version from this link:

Afterwards, I installed torchvision, which we’re using in the project via pip: python3 -m pip install torchvision.

After launching the application, an error occured. The error message said that the lib “couldn’t load custom C++ ops due to either incompatible pytorch and torchvision versions or problems when building the packages from source”. Unfortunately, I can’t provide a screenshot and/or log, because I don’t have internet access on the device at the moment.

Anyways, I’ve checked the compatibility matrix on official pytorch/vision repo and I don’t see a compatible torchvision version to pytorch that’s available for my platform:

Any feedback will be helpful, I will post logs and images under this thread once my internet connection comes back up.

EDIT: Here the actual error message:
RuntimeError: Couldn’t load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check [GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision ]( for the compatibility matrix. Please check your PyTorch version with torch.**version** and your torchvision version with torchvision.**version** and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.


I am going to move your topic to the Jetson category for better visibility.

Hi @robert.koziarski, please try building/installing torchvision from source - you can find the directions in this topic:

$ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
$ git clone --branch <version> 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 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

If you continue to have issues, you could also try using the l4t-pytorch container images which come with PyTorch and torchvision pre-installed.

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