Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail: ValueError: Could not find the operator torchvision::nms. Please make sure you have already registered the operator and (if registered from C++) loaded it via torch.ops.load_library. #8278

Closed
yurivict opened this issue Feb 23, 2024 · 1 comment

Comments

@yurivict
Copy link

🐛 Describe the bug

===>   py39-torchvision-0.17.1 depends on file: /usr/local/bin/python3.9 - found
cd /usr/ports/misc/py-torchvision/work-py39/vision-0.17.1 && /usr/bin/env XDG_DATA_HOME=/usr/ports/misc/py-torchvision/work-py39  XDG_CONFIG_HOME=/usr/ports/misc/py-torchvision/work-py39  XDG_CACHE_HOME=/usr/ports/misc/py-torchvision/work-py39/.cache  HOME=/usr/ports/misc/py-torchvision/work-py39 PATH=/usr/local/libexec/ccache:/usr/ports/misc/py-torchvision/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/misc/py-torchvision/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES LDSHARED="cc -shared" PYTHONDONTWRITEBYTECODE= PYTHONOPTIMIZE= PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" /usr/local/bin/python3.9 -m pytest -k '' -rs -v -o addopts= 
ImportError while loading conftest '/usr/ports/misc/py-torchvision/work-py39/vision-0.17.1/test/conftest.py'.
test/conftest.py:7: in <module>
    from common_utils import (
test/common_utils.py:22: in <module>
    from torchvision import io, tv_tensors
torchvision/__init__.py:6: in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils
torchvision/_meta_registrations.py:164: in <module>
    def meta_nms(dets, scores, iou_threshold):
/usr/local/lib/python3.9/site-packages/torch/_custom_ops.py:253: in inner
    custom_op = _find_custom_op(qualname, also_check_torch_library=True)
/usr/local/lib/python3.9/site-packages/torch/_custom_op/impl.py:1076: in _find_custom_op
    overload = get_op(qualname)
/usr/local/lib/python3.9/site-packages/torch/_custom_op/impl.py:1062: in get_op
    error_not_found()
/usr/local/lib/python3.9/site-packages/torch/_custom_op/impl.py:1052: in error_not_found
    raise ValueError(
E   ValueError: Could not find the operator torchvision::nms. Please make sure you have already registered the operator and (if registered from C++) loaded it via torch.ops.load_library.
*** Error code 4

Versions

$ python3.9 collect_env.py 
Collecting environment information...
PyTorch version: 2.1.0a0
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: freebsd14
GCC version: Could not collect
Clang version: 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
CMake version: version 3.28.3
Libc version: N/A

Python version: 3.9.18 (main, Dec 10 2023, 01:22:40)  [Clang 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1 (64-bit runtime)
Python platform: FreeBSD-14.0-STABLE-amd64-64bit-ELF
Is CUDA available: False
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2060
Nvidia driver version: 535.104.05
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False

CPU:


Versions of relevant libraries:
[pip3] flake8==6.1.0
[pip3] mypy==1.8.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.25.0
[pip3] pytest-flake8==1.1.1
[pip3] pytest-mypy==0.10.3
[pip3] torch==2.1.0a0+gitunknown
[pip3] torchvision==0.17.1+06c0f5e
[conda] Could not collect
@NicolasHug
Copy link
Member

Hi @yurivict

[pip3] torch==2.1.0a0+gitunknown
[pip3] torchvision==0.17.1+06c0f5e

You will need torch 2.2.1 for it to work with torchvision 0.17.1. Try to update torch and LMK if the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants