Orin AGX pyTorch SDK 513

Hi,
I have installed torch-2.1.0a0+41361538.nv23.06-cp38-cp38-linux_aarch64.whl and I need torchvision, too. I created vision from source (FORCE_CUDA=1 python3 setup.py develop) but it does not import

import torchvision
Traceback (most recent call last):
File “”, line 1, in
File “/home/nvidia/vision/torchvision/init.py”, line 6, in
from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils
File “/home/nvidia/vision/torchvision/_meta_registrations.py”, line 4, in
import torch._custom_ops
ModuleNotFoundError: No module named ‘torch._custom_ops’

BR
Bernd

Hi,

There are dependencies between PyTorch and TorchVision.
Which TorchVision version are you trying to build?

Based on the below document, it should be v0.16.0.

Thanks.

I have a similar issue with Jetpack 5.1.2 and torch 2.1.0a0+41361538.nv23.06.

I cloned torchvision and checkout v0.16.0.

FORCE_CUDA=1 sudo python3 setup.py install

I get error during import:

import torchvision
/usr/local/lib/python3.8/dist-packages/torchvision-0.16.0+fbb4cc5-py3.8-linux-aarch64.egg/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/usr/local/lib/python3.8/dist-packages/torchvision-0.16.0+fbb4cc5-py3.8-linux-aarch64.egg/torchvision/image.so: undefined symbol: _ZNK3c1017SymbolicShapeMeta18init_is_contiguousEv’If you don’t plan on using image functionality from torchvision.io, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have libjpeg or libpng installed before building torchvision from source?
warn(
torchvision.version
‘0.16.0+fbb4cc5’
import torch
torch.version
‘2.1.0a0+41361538.nv23.06’

I solved it with:

FORCE_CUDA=1 python3 setup.py install --user

Same problem here, torchvision failed to install properly in a virtual environment with the nvidia-provided pytorch. Moving everything to system Python (although in my user folder), works, although it is a kludge because I cannot isolate the environments.

HI, @david.mh

Suppose you fix the issue after switching to the system python, is that correct?
Thanks.

Hi,
I create a new system with sdkmanager 5.13 on Xavier AGX. It install python 3.10 and Cuda 11.x (I think it is 11.4) by default. I use a new creeated system image and use the instructions from Nvidia to create a new pytorch image, (ex. 2.1.0). this fails as I described before.
The same commands succeed on SDK6 on Orin AGX (just for test, the precompiled whl for 2.1.0 also works). 2.2.0 on Orin also works but torchvision fails so I have to dewngrade to 2.1.0

BR
Bernd Sowislo

Yes, although in a virtual environment I was using the same version. I don’t know what the difference is.

Hi,

We only provide the package for default Python.
JetPack 5 is 3.8 and JetPack 6 is 3.10.

If you want to use PyTorch with a non-default Python version.
Please build it from the source instead.

The building command can be found in the below topic:

Thanks.

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