RuntimeError: operator torchvision::nms does not exist

To reproduce

pip install --pre torch torchvision torchaudio -i

(taken from Pytorch Bench README)


python -c "import torchvision"



Python 3.8.10



pip show torchvision

Name: torchvision
Version: 0.17.0.dev20231129+cu118
Summary: image and video datasets and models for torch deep learning
Author: PyTorch Core Team
License: BSD
Location: /data/agoldf6/mypy/lib/python3.8/site-packages
Requires: numpy, torch, pillow, requests
Required-by: x-clip, torchbench, torch-fidelity, timm, open-clip-torch, lpips, effdet, dalle2-pytorch, DALL-E, clip-anytorch

Full output:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/data/agoldf6/mypy/lib/python3.8/site-packages/torchvision/", line 6, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils
  File "/data/agoldf6/mypy/lib/python3.8/site-packages/torchvision/", line 164, in <module>
    def meta_nms(dets, scores, iou_threshold):
  File "/data/agoldf6/mypy/lib/python3.8/site-packages/torch/", line 439, in inner
    handle = entry.abstract_impl.register(func_to_register, source)
  File "/data/agoldf6/mypy/lib/python3.8/site-packages/torch/_library/", line 30, in register
    if torch._C._dispatch_has_kernel_for_dispatch_key(self.qualname, "Meta"):
RuntimeError: operator torchvision::nms does not exist

Your install command specifies cu118 while you’ve installed the CPU-only binaries, so something failed. Make sure you have a single torch and torchvision installation with the same CUDA runtime dependencies.

1 Like