question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

torchvision.ops.batched_nms() crashes with pytorch 1.9.0 and torchvision 0.10.0

See original GitHub issue

🐛 Bug

with the just released pytorch 1.9.0 and torchvision 0.10.0 torchvision.ops.batched_nms() crashes on my machine with the following error:

RuntimeError: Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.__version__ and your torchvision version with torchvision.__version__ and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

Since both are of the current version, I guess they should be compatible (they are not yet listed in the compatibility matrix).

To Reproduce

Steps to reproduce the behavior:

this example code shows the behavior on my machine:

import torch as th
import torchvision as tv

boxes = th.zeros(1000, 4)
scores = th.zeros(1000)
idxs = th.zeros(1000)

tv.ops.batched_nms(boxes, scores, idxs, 0.5)

Expected behavior

This should not result in an error.

Environment

Collecting environment information… PyTorch version: 1.9.0 Is debug build: False CUDA used to build PyTorch: 10.2 ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.5 LTS (x86_64) GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Clang version: Could not collect CMake version: Could not collect Libc version: glibc-2.27

Python version: 3.9 (64-bit runtime) Python platform: Linux-4.15.0-144-generic-x86_64-with-glibc2.27 Is CUDA available: True CUDA runtime version: Could not collect GPU models and configuration: GPU 0: Tesla V100-SXM2-32GB GPU 1: Tesla V100-SXM2-32GB

Nvidia driver version: 460.32.03 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A

Versions of relevant libraries: [pip3] numpy==1.20.2 [pip3] torch==1.9.0 [pip3] torchaudio==0.9.0a0+33b2469 [pip3] torchvision==0.10.0 [conda] blas 1.0 mkl
[conda] cudatoolkit 10.2.89 h8f6ccaa_8 conda-forge [conda] ffmpeg 4.3 hf484d3e_0 pytorch [conda] mkl 2021.2.0 h726a3e6_389 conda-forge [conda] mkl-service 2.4.0 py39h3811e60_0 conda-forge [conda] mkl_fft 1.3.0 py39h42c9631_2
[conda] mkl_random 1.2.2 py39hde0f152_0 conda-forge [conda] numpy 1.20.2 py39h2d18471_0
[conda] numpy-base 1.20.2 py39hfae3a4d_0
[conda] pytorch 1.9.0 py3.9_cuda10.2_cudnn7.6.5_0 pytorch [conda] torchaudio 0.9.0 py39 pytorch [conda] torchvision 0.10.0 py39_cu102 pytorch

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
ChouCHou-ycommented, Aug 7, 2021

with the just released pytorch 1.9.0 and torchvision 0.10.0 torchvision.ops.batched_nms() crashes on my machine with the following error:

RuntimeError: Couldn’t load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

how to solve?please

2reactions
malfetcommented, Jun 21, 2021

I think difference can be explained by presence/absence of conda-forge in ones .condarc. I got the repro after removing conda-forge dependency, but than fixed it by enabling it in the install command as follows:

conda create -n test python=3.9 pytorch torchvision cudatoolkit=11.1 -c pytorch -c nvidia -c conda-forge
Read more comments on GitHub >

github_iconTop Results From Across the Web

Install pytorch 1.9.0 with unexpected problem
I follow the official guide to install pytorch 1.9.0 + cuda11.3 conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 ...
Read more >
NotImplementedError: Could not run 'torchvision::nms' with ...
Hi, when I try to run Yolov5 I got this error: NotImplementedError: Could not run 'torchvision::nms' with arguments from the 'CUDA' backend.
Read more >
Torchvision 0.10.0 documentation - PyTorch
This library is part of the PyTorch project. PyTorch is an open source machine learning framework. Features described in this documentation are classified...
Read more >
M1 macOS 12.3 torchvision.ops.nms error - mps
Testing with mps.is_available() returns True (yeah!). But when running YoloX model, the system crashes with the following error: ox_files ...
Read more >
Previous PyTorch Versions
CUDA 10.2 conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch # CUDA 11.3 conda install pytorch==1.9.0 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found