Error with PyTorch 2.0.0+nv23.05 and torchvision on Jetson Orin Nano - Compatibility Issue

Hi everyone,

I’m running into an issue with Ultralytics on my Jetson Orin Nano and could use some help. Here’s my setup:

Device: Jetson Orin Nano
PyTorch Version: 2.0.0+nv23.05 (installed via NVIDIA’s Jetson wheel, CUDA-enabled)
CUDA: 11.4 (verified with torch.version.cuda)
torch.cuda.is_available(): True
Device Name: "Orin"

I’ve built torchvision from source using:
bash
git clone --branch GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision torchvision
cd torchvision
python setup.py install

I’ve tried multiple versions:

0.15.1a0+42759b1 (commit from branch v0.15.1)
0.16.0
0.16.1

I also tested with PyTorch 2.1.0a0+41361538.nv23.06, but I’m currently using 2.0.0+nv23.05.

Problem: When I run a YOLOv8 model with Ultralytics (from ultralytics import YOLO), I get this error:
text
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.

Verification:
bash
python -c “import torch; print(torch.version); print(torch.cuda.is_available()); print(torch.version.cuda)”

Output: 2.0.0+nv23.05, True, 11.4
bash
python -c “import torchvision; print(torchvision.version)”

Output: 0.15.1a0+42759b1 (or 0.16.0/0.16.1 depending on the build).

What I’ve Tried:

Built torchvision from source with different tags (v0.15.1, v0.16.0, v0.16.1).
Ensured dependencies like libjpeg-dev, libpng-dev, cmake, and g++ are installed.
Checked the PyTorch/torchvision compatibility matrix, which suggests torchvision 0.15.1 for PyTorch 2.0.0 and 0.16.0 for 2.1.0.

Questions:

Is there a specific torchvision version or commit that works with PyTorch 2.0.0+nv23.05 on Jetson Orin Nano?
Could the +nv23.05 Jetson build affect compatibility with standard torchvision releases?
Any tips to resolve the "Couldn't load custom C++ ops" error when using Ultralytics YOLOv8?

I’d appreciate any guidance on getting YOLOv8 running with GPU support. Thanks!

Hi,

Please find the below comment to run Ultralytics on JetPack 5 environment:

Thanks.

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