zhengye1995 / Zero-shot-Instance-Segmentation

code for CVPR paper Zero-shot Instance Segmentation
Apache License 2.0
93 stars 14 forks source link

ImportError: mmdet/core/nms/nms_cpu.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c106detail23torchInternalAssertFailEPKcS2_jS2_S2_ #10

Closed harrytrinh2 closed 3 years ago

harrytrinh2 commented 3 years ago

I am reproducing this work using the latest mmdet version. Inside the file barpn_head.py, I need to import nms from ops (from mmdet.ops import nms). However, in the new architecture of mmdet, there is no folder named ops inside mmdet, therefore, I copied the whole nnm folder from the old mmdet version. And I got this error: ImportError: mmdet/core/nms/nms_cpu.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c106detail23torchInternalAssertFailEPKcS2_jS2_S2_ #10. That is because these two lines inside `nns_wrapper.py":

from . import nms_cpu, nms_cuda
from .soft_nms_cpu import soft_nms_cpu

It is failed to load these modules from the following files:

  1. nms_cpu.cpython-37m-x86_64-linux-gnu.so
  2. nms_cuda.cpython-37m-x86_64-linux-gnu.so
  3. soft_nms_cpu.cpython-37m-x86_64-linux-gnu.so

Do you know how to get away with this problem? Note that in the new mmdet version, it does not have ops folder after compiling from mmcv

zhengye1995 commented 3 years ago

The operations in ops have been moved into mmcv package, if you need to use nms, you can import it from mmcv, see https://github.com/open-mmlab/mmcv/blob/bf2c9fa8d21e4af903769b3d7aca20452e4b4669/mmcv/ops/nms.py

harrytrinh2 commented 3 years ago

Very correct! How did you know it has been moved to mmcv?

zhengye1995 commented 3 years ago

I am a super fan for mmlab, especially for mmdetection. I have won many awards in object detection competitions using mmdetection.

harrytrinh2 commented 3 years ago

Hehe, good for you! This framework is very hard to understand how it works under the hood, but once you get the idea, it'd be very lovely then :)