No module named 'torch._custom_ops'

I am working on NVIDIA-Jetson (Jetson 5.1). For our work, we strictly need torch version1.14.1 package only.

I downloaded the whl file of PyTorch 1.14.1 supported for Jetson 5.1 from the official listings which are listed for Jetson by NVIDIA. We couldn’t find torch 1.14.1’s corresponding torchvison version on PyTorch’s website or anywhwere else.

So according this thread we tried to build it from source (source repo) and encountered no error message.

But now while importing torchvision to my codebase, I get the following error-message : -
from torchvision import _meta_registrations, datasets, io, models,
ops, transforms, utils
File
“/home/vision/GBCxFasterRCNN_GUI/vision-main/torchvision/_meta_registrations.py”,
line 4, in
import torch._custom_ops
ModuleNotFoundError: No module named ‘torch._custom_ops’

Kindly help resolving.

Hi,

Which TorchVision version do you install?
You can also find this information in the topic you shared:

https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048

Installation

  • torchvision
    • PyTorch v1.14 - torchvision v0.14.1

Thanks.

Hi, thanks for the reply!

We’re not able to find any link to install TorchVision 0.14.1. That is why we tried to build it from the source as instructed by How to install torchvision with torch1.14.0 with CUDA 11.4.

The above thread said that we just need PyTorch installed in our environment. Then directly run python setup.py install after cloning the official repo.
The TorchVision installed with this was 0.19.0.

Hi,

You will need to match the version to avoid the compatible issue.
Please use 0.14.1 TorchVision for PyTorch 1.14.

Thanks.

Thanks, issue resolved.

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