-
Notifications
You must be signed in to change notification settings - Fork 7k
RuntimeError: No such operator torchvision::nms #1916
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
Comments
Hi, Thanks for the bug report! There seems to be an issue with our binaries, at least for Windows. @peterjc123 do you know if this is a known problem? |
I updated my CUDA Toolkit to 10.1 update2 and matching cuDNN to v7.6.5
but I still get the same error. |
Sorry, I could not reproduce this error with torch==1.4.0 and torchvision==0.5.0 with python=3.7 and cudatoolkit=10.1. Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torchvision
>>> import torch
>>> torch.ops.torchvision.nms
<built-in method nms of PyCapsule object at 0x0000029BF9F74150> My env:
|
It seems that when I do
I get Then when I do
I get But if I specifically create a python 3.7 environment
I get Then
I also get
So the issue seems to be with |
You mean it's Python 3.8 only issue, right? I'll check later. |
Yes it seems so. |
I have the same issue. I'll try @davidsteinar solution. I'll remove the environment and create a new one for that. Thanks @davidsteinar and @peterjc123 |
I tried and it is actually a DLL loading problem for Python 3.8. The workground is to add the directory of cuda before importing torchvision using the following code. import os
import sys
py_dll_path = os.path.join(sys.exec_prefix, 'Library', 'bin')
os.add_dll_directory(py_dll_path) |
Summary: The way it works on the Anaconda distribution of Python 3.8 is a bit different. Loading DLLs explicitly (e.g. `ctype.CDLL`) relies on paths appended by `os.add_dll_directory`. But if you try to load DLLs implicitly (e.g. `from torch._C import *`), it will rely on `PATH`. Fixes pytorch/vision#1916. Pull Request resolved: #33856 Differential Revision: D20150080 Pulled By: soumith fbshipit-source-id: cdbe76c138ea259ef7414c6634d4f7e0b1871af3
Summary: The way it works on the Anaconda distribution of Python 3.8 is a bit different. Loading DLLs explicitly (e.g. `ctype.CDLL`) relies on paths appended by `os.add_dll_directory`. But if you try to load DLLs implicitly (e.g. `from torch._C import *`), it will rely on `PATH`. Fixes pytorch/vision#1916. Pull Request resolved: pytorch#33856 Differential Revision: D20150080 Pulled By: soumith fbshipit-source-id: cdbe76c138ea259ef7414c6634d4f7e0b1871af3
In Python 3.6 the solution will give the error:
So I solved my issue adding this before importing
|
@nicolas-gervais This shouldn't be needed for Python 3.6. Could you please tell me something about your env, like how did you install python, pytorch and torchvision? |
How to show the Environment? |
|
Hello, I also encountered this issue with python3.6, here is my environment: OS: Ubuntu 18.04.4 LTS Python version: 3.6 Nvidia driver version: 384.130 Versions of relevant libraries: |
I encountered the same issue in pytorch 1.5
|
I also encountered the same error with PyTorch-1.5.0 and torchvision-0.5.0. Below are the details of my environment. Collecting environment information... OS: CentOS Linux release 7.7.1908 (Core) Python version: 3.7 Versions of relevant libraries: |
I am also having the same issue on PyTorch nightly build.
|
Solved. In my case the error occurred because I used different machines with different GPUs for building torchvision and running training. Specifying CUDA compute capability such as |
Could you explain how do we can Specifying CUDA compute capability such as TORCH_CUDA_ARCH_LIST="6.0;6.1;7.0" when building torchvision resolved this? |
@ebrahim31 just pass
when compiling torchvision. |
I get another error that add_dll_directory is not an implemented function of os module. |
@yustiks In torchvision we have a guard for this see vision/torchvision/extension.py Lines 27 to 34 in b93d5ee
Please open a new issue if you hit an issue with torchvision |
I also encounter the same issue. In my case, nvidia-smi: CUDA 11.0 and I installed pytorch using torchtoolkit 10.1. |
🐛 Bug
Ran into this issue when trying to use Faster R-CCC example on a Windows machine.
RuntimeError: No such operator torchvision::nms
To Reproduce
Steps to reproduce the behavior:
and then
Expected behavior
To be able to use torchvision.nms ...
Environment
and
The text was updated successfully, but these errors were encountered: