Error in pytorch & torchvision on Xavier NX JP 5.0.1 DP

I installed pytorch and torchvision on Xavier NX JP 5.0.1 DP following the instructions in the link below:

but I get below warning:

import torchvision
/home/hekun/Downloads/torchvision/torchvision/io/ UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")
/home/hekun/Downloads/torchvision/torchvision/ UserWarning: You are importing torchvision within its own root folder (/home/hekun/Downloads/torchvision). This is not expected to work and may give errors. Please exit the torchvision project source and relaunch your python interpreter.
import torch
print('CUDA available: ’ + str(torch.cuda.is_available()))
CUDA available: True
print('cuDNN version: ’ + str(torch.backends.cudnn.version()))
cuDNN version: 8302

And I get the following error when running yolov5 training:

File “/home/hekun/.local/lib/python3.8/site-packages/torchvision/”, line 33, in _assert_has_ops
raise RuntimeError(
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.

Could you help me? Thanks a lot!


Could you check if the same error occurs when using l4t-pytorch:r34.1.0-pth1.12-py3 container below?


I am running into the same issue: the container works fine but the download doesn’t. It seems like there is a missing dependency that is picked up in the container but not in the download. Nosing around, it seems as if this is torch/torchvision issue (it appears elsewhere) and not an nvidia problem as such.

Ok, for what it is worth, what I wound up doing is to download and install pytorch per the instructions and then built the latest version of torchvision from source. That seemed to cure the problem as of today :-)

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