Installing the right torchvision for the torch in jetson orin yolo

i’ve installed torch here ( Installing PyTorch for Jetson Platform - NVIDIA Docs to get the torch that support jetson orin gpu.
And right after that i installed the torchvision to suit the torch version here PyTorch for Jetson - Jetson & Embedded Systems / Announcements - NVIDIA Developer Forums but i keep getting this error:

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 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’m looking forward for any suggestion/help… thanks…


Based on the log, the packages are not compatible.

Could you share the JetPack, PyTorch, and the TorchVision version you installed with us?
A known working combination is PyTorch v2.0.0 + Torchvision v0.14.1.

Or you can try our container with both PyTorch and TorchVision installed for simplicity.


I have not been able to get it to work on a Devkit under a virtualenv, but it does work on the system Python.


Could you share the issue/error you meet under a virtualenv?
Have you tried to create the environment with --system-site-packages?


See it here: Orin AGX pyTorch SDK 513 - #4 by Gorgo90

Pytorch and torchvision installed inside the virtual environment, it shouldn’t have any dependencies on system’s site packages, no?


I might misunderstand the system Python you mentioned.

Do you mean you create the virtual environment with Python 3.8 (JetPack 5.1.2) and it works?
But since we only provide the package for the default Python version, you will need to build from the source for other python versions.



If I create a virtual environment with the same Python version as system’s Python (3.8), it doesn’t work. If I install it directly on the system Python (at $HOME/.local/lib/python3.8/site-packages), it works.


The error shows RuntimeError: Couldn't load custom C++ ops..
Somehow the package can load the module natively but not within a virtual environment.

Sorry that we don’t know the implementation details since this is a third-party library.
But since the package can work natively, creating the environment with --system-site-packages should help you access the C-based library on the system.

Does it work?


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