Error when importing torchvision on Jetson Orin Nano: operator torchvision::nms does not exist

I am running Orin Nano Jetpack v6.2, See version details below:

Software part of jetson-stats 4.3.2 - (c) 2024, Raffaello Bonghi
Model: NVIDIA Jetson Orin Nano Engineering Reference Developer Kit Super - Jetpack 6.2 [L4T 36.4.3]
NV Power Mode[1]: 25W
Serial Number: [XXX Show with: jetson_release -s XXX]
Hardware:
 - P-Number: p3767-0005
 - Module: NVIDIA Jetson Orin Nano (Developer kit)
Platform:
 - Distribution: Ubuntu 22.04 Jammy Jellyfish
 - Release: 5.15.148-tegra
jtop:
 - Version: 4.3.2
 - Service: Active
Libraries:
 - CUDA: 12.6.68
 - cuDNN: 9.8.0
 - TensorRT: 10.3.0.30
 - VPI: 3.2.4
 - Vulkan: 1.3.204
 - OpenCV: 4.8.0 - with CUDA: NO

I am following the pytorch install steps mentioned in link below:

On installing pytorch and torchvision, the below error is encountered:

NOTE: I am running in a virtualenv

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/username/Tech/lang/python/cuda-test/torchvision/torchvision/__init__.py", line 10, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils  # usort:skip
  File "/home/username/Tech/lang/python/cuda-test/torchvision/torchvision/_meta_registrations.py", line 164, in <module>
    def meta_nms(dets, scores, iou_threshold):
  File "/home/username/Tech/lang/python/cuda-test/torchvision/venv/lib/python3.10/site-packages/torch/library.py", line 795, in register
    use_lib._register_fake(op_name, func, _stacklevel=stacklevel + 1)
  File "/home/username/Tech/lang/python/cuda-test/torchvision/venv/lib/python3.10/site-packages/torch/library.py", line 184, in _register_fake
    handle = entry.fake_impl.register(func_to_register, source)
  File "/home/username/Tech/lang/python/cuda-test/torchvision/venv/lib/python3.10/site-packages/torch/_library/fake_impl.py", line 31, in register
    if torch._C._dispatch_has_kernel_for_dispatch_key(self.qualname, "Meta"):
RuntimeError: operator torchvision::nms does not exist

Can you advise on what is causing this error and how to fix this.

Thanks

check if you can find some thing out of this link:

Tried, but same error torchvision::nms does not exist, See log below:

(venv) username@orin:~/Tech/lang/python/cuda-test/torchvision$ pip3 install 'numpy<2'
Requirement already satisfied: numpy<2 in ./venv/lib/python3.10/site-packages (1.26.4)
(venv) username@orin:~/Tech/lang/python/cuda-test/torchvision$ wget https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/6cc/6ecfe8a5994fd/torch-2.6.0-cp310-cp310-linux_aarch64.whl#sha256=6cc6ecfe8a5994fd6d58fb6d6eb73ff2437428bb4953f3ebaa409f83a5f4db99 
--2025-04-11 17:49:56--  https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/6cc/6ecfe8a5994fd/torch-2.6.0-cp310-cp310-linux_aarch64.whl
Resolving pypi.jetson-ai-lab.dev (pypi.jetson-ai-lab.dev)... 108.39.248.12
Connecting to pypi.jetson-ai-lab.dev (pypi.jetson-ai-lab.dev)|108.39.248.12|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 240762484 (230M) [None]
Saving to: ‘torch-2.6.0-cp310-cp310-linux_aarch64.whl’

torch-2.6.0-cp310-cp310-linux_aar 100%[===========================================================>] 229.61M  7.19MB/s    in 46s     

2025-04-11 17:50:44 (5.02 MB/s) - ‘torch-2.6.0-cp310-cp310-linux_aarch64.whl’ saved [240762484/240762484]

(venv) username@orin:~/Tech/lang/python/cuda-test/torchvision$ wget https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/aa2/2da8dcf4c4c8d/torchvision-0.21.0-cp310-cp310-linux_aarch64.whl#sha256=aa22da8dcf4c4c8dc897e7922b1ef25cb0fe350e1a358168be87a854ad114531
--2025-04-11 17:50:46--  https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/aa2/2da8dcf4c4c8d/torchvision-0.21.0-cp310-cp310-linux_aarch64.whl
Resolving pypi.jetson-ai-lab.dev (pypi.jetson-ai-lab.dev)... 108.39.248.12
Connecting to pypi.jetson-ai-lab.dev (pypi.jetson-ai-lab.dev)|108.39.248.12|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1468289 (1.4M) [None]
Saving to: ‘torchvision-0.21.0-cp310-cp310-linux_aarch64.whl’

torchvision-0.21.0-cp310-cp310-li 100%[===========================================================>]   1.40M  1.05MB/s    in 1.3s    

2025-04-11 17:50:48 (1.05 MB/s) - ‘torchvision-0.21.0-cp310-cp310-linux_aarch64.whl’ saved [1468289/1468289]

(venv) username@orin:~/Tech/lang/python/cuda-test/torchvision$ pip3 install --force torch-2.6.0-cp310-cp310-linux_aarch64.whl 
Processing ./torch-2.6.0-cp310-cp310-linux_aarch64.whl
Collecting sympy==1.13.1
  Using cached sympy-1.13.1-py3-none-any.whl (6.2 MB)
Collecting fsspec
  Using cached fsspec-2025.3.2-py3-none-any.whl (194 kB)
Collecting jinja2
  Using cached jinja2-3.1.6-py3-none-any.whl (134 kB)
Collecting filelock
  Using cached filelock-3.18.0-py3-none-any.whl (16 kB)
Collecting typing-extensions>=4.10.0
  Using cached typing_extensions-4.13.2-py3-none-any.whl (45 kB)
Collecting networkx
  Using cached networkx-3.4.2-py3-none-any.whl (1.7 MB)
Collecting mpmath<1.4,>=1.1.0
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (21 kB)
Installing collected packages: mpmath, typing-extensions, sympy, networkx, MarkupSafe, fsspec, filelock, jinja2, torch
  Attempting uninstall: mpmath
    Found existing installation: mpmath 1.3.0
    Uninstalling mpmath-1.3.0:
      Successfully uninstalled mpmath-1.3.0
  Attempting uninstall: typing-extensions
    Found existing installation: typing_extensions 4.13.2
    Uninstalling typing_extensions-4.13.2:
      Successfully uninstalled typing_extensions-4.13.2
  Attempting uninstall: sympy
    Found existing installation: sympy 1.13.1
    Uninstalling sympy-1.13.1:
      Successfully uninstalled sympy-1.13.1
  Attempting uninstall: networkx
    Found existing installation: networkx 3.4.2
    Uninstalling networkx-3.4.2:
      Successfully uninstalled networkx-3.4.2
  Attempting uninstall: MarkupSafe
    Found existing installation: MarkupSafe 3.0.2
    Uninstalling MarkupSafe-3.0.2:
      Successfully uninstalled MarkupSafe-3.0.2
  Attempting uninstall: fsspec
    Found existing installation: fsspec 2025.3.2
    Uninstalling fsspec-2025.3.2:
      Successfully uninstalled fsspec-2025.3.2
  Attempting uninstall: filelock
    Found existing installation: filelock 3.18.0
    Uninstalling filelock-3.18.0:
      Successfully uninstalled filelock-3.18.0
  Attempting uninstall: jinja2
    Found existing installation: Jinja2 3.1.6
    Uninstalling Jinja2-3.1.6:
      Successfully uninstalled Jinja2-3.1.6
  Attempting uninstall: torch
    Found existing installation: torch 2.5.0
    Uninstalling torch-2.5.0:
      Successfully uninstalled torch-2.5.0
Successfully installed MarkupSafe-3.0.2 filelock-3.18.0 fsspec-2025.3.2 jinja2-3.1.6 mpmath-1.3.0 networkx-3.4.2 sympy-1.13.1 torch-2.6.0 typing-extensions-4.13.2
(venv) username@orin:~/Tech/lang/python/cuda-test/torchvision$ pip3 install --force torchvision-0.21.0-cp310-cp310-linux_aarch64.whl 
Processing ./torchvision-0.21.0-cp310-cp310-linux_aarch64.whl
Collecting numpy
  Using cached numpy-2.2.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.4 MB)
Collecting pillow!=8.3.*,>=5.3.0
  Using cached pillow-11.1.0-cp310-cp310-manylinux_2_28_aarch64.whl (4.4 MB)
Collecting torch
  Using cached torch-2.6.0-cp310-cp310-manylinux_2_28_aarch64.whl (95.8 MB)
Collecting sympy==1.13.1
  Using cached sympy-1.13.1-py3-none-any.whl (6.2 MB)
Collecting networkx
  Using cached networkx-3.4.2-py3-none-any.whl (1.7 MB)
Collecting jinja2
  Using cached jinja2-3.1.6-py3-none-any.whl (134 kB)
Collecting typing-extensions>=4.10.0
  Using cached typing_extensions-4.13.2-py3-none-any.whl (45 kB)
Collecting filelock
  Using cached filelock-3.18.0-py3-none-any.whl (16 kB)
Collecting fsspec
  Using cached fsspec-2025.3.2-py3-none-any.whl (194 kB)
Collecting mpmath<1.4,>=1.1.0
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (21 kB)
Installing collected packages: mpmath, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, fsspec, filelock, jinja2, torch, torchvision
  Attempting uninstall: mpmath
    Found existing installation: mpmath 1.3.0
    Uninstalling mpmath-1.3.0:
      Successfully uninstalled mpmath-1.3.0
  Attempting uninstall: typing-extensions
    Found existing installation: typing_extensions 4.13.2
    Uninstalling typing_extensions-4.13.2:
      Successfully uninstalled typing_extensions-4.13.2
  Attempting uninstall: sympy
    Found existing installation: sympy 1.13.1
    Uninstalling sympy-1.13.1:
      Successfully uninstalled sympy-1.13.1
  Attempting uninstall: pillow
    Found existing installation: pillow 11.2.0
    Uninstalling pillow-11.2.0:
      Successfully uninstalled pillow-11.2.0
  Attempting uninstall: numpy
    Found existing installation: numpy 1.26.4
    Uninstalling numpy-1.26.4:
      Successfully uninstalled numpy-1.26.4
  Attempting uninstall: networkx
    Found existing installation: networkx 3.4.2
    Uninstalling networkx-3.4.2:
      Successfully uninstalled networkx-3.4.2
  Attempting uninstall: MarkupSafe
    Found existing installation: MarkupSafe 3.0.2
    Uninstalling MarkupSafe-3.0.2:
      Successfully uninstalled MarkupSafe-3.0.2
  Attempting uninstall: fsspec
    Found existing installation: fsspec 2025.3.2
    Uninstalling fsspec-2025.3.2:
      Successfully uninstalled fsspec-2025.3.2
  Attempting uninstall: filelock
    Found existing installation: filelock 3.18.0
    Uninstalling filelock-3.18.0:
      Successfully uninstalled filelock-3.18.0
  Attempting uninstall: jinja2
    Found existing installation: Jinja2 3.1.6
    Uninstalling Jinja2-3.1.6:
      Successfully uninstalled Jinja2-3.1.6
  Attempting uninstall: torch
    Found existing installation: torch 2.6.0
    Uninstalling torch-2.6.0:
      Successfully uninstalled torch-2.6.0
  Attempting uninstall: torchvision
    Found existing installation: torchvision 0.20.0
    Uninstalling torchvision-0.20.0:
      Successfully uninstalled torchvision-0.20.0
Successfully installed MarkupSafe-3.0.2 filelock-3.18.0 fsspec-2025.3.2 jinja2-3.1.6 mpmath-1.3.0 networkx-3.4.2 numpy-2.2.4 pillow-11.1.0 sympy-1.13.1 torch-2.6.0 torchvision-0.21.0 typing-extensions-4.13.2
(venv) username@orin:~/Tech/lang/python/cuda-test/torchvision$ python3
Python 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import torchvision
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/username/Tech/lang/python/cuda-test/torchvision/torchvision/__init__.py", line 10, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils  # usort:skip
  File "/home/username/Tech/lang/python/cuda-test/torchvision/torchvision/_meta_registrations.py", line 164, in <module>
    def meta_nms(dets, scores, iou_threshold):
  File "/home/username/Tech/lang/python/cuda-test/torchvision/venv/lib/python3.10/site-packages/torch/library.py", line 828, in register
    use_lib._register_fake(op_name, func, _stacklevel=stacklevel + 1)
  File "/home/username/Tech/lang/python/cuda-test/torchvision/venv/lib/python3.10/site-packages/torch/library.py", line 198, in _register_fake
    handle = entry.fake_impl.register(func_to_register, source)
  File "/home/username/Tech/lang/python/cuda-test/torchvision/venv/lib/python3.10/site-packages/torch/_library/fake_impl.py", line 31, in register
    if torch._C._dispatch_has_kernel_for_dispatch_key(self.qualname, "Meta"):
RuntimeError: operator torchvision::nms does not exist
>>> 

Root cause of this problem is as below-

The recommended packages are:

  • torch-2.6.0
  • torchvision-0.21.0

When torch-2.6.0 is first installed, the subsequent torchvision install suggested here has a dependency which is not satisfied with torch-2.6.0 ( installed earlier ).

It ends up uninstalling the earlier installed torch as seen here:

  Attempting uninstall: torchvision
    Found existing installation: torchvision 0.20.0
    Uninstalling torchvision-0.20.0: <======================================= ??????
      Successfully uninstalled torchvision-0.20.0

This results in a version of torch which does not work with torchvision,
Installing torchvision without dependancy is one way of working around it but could cause other issues.

2 Likes

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