Mmdetection: undefined symbol: _ZN2at5ErrorC1ENS_14SourceLocationESs

Created on 19 Oct 2018  Â·  16Comments  Â·  Source: open-mmlab/mmdetection

I need your help : )
ImportError: /home/wangshuainan/mmdetection/mmdet/ops/roi_align/roi_align_cuda.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at5ErrorC1ENS_14SourceLocationESs

Most helpful comment

@qpanpony
there is a script for setting up mmdetection with conda for reference, i have solved my problem by refer to the script.
This is my own step to solve the problem:

  1. python 3.5 --> python=3.6
  2. conda install pytorch==0.4.1 --> conda install pytorch torchvision -c pytorch(use official source)
  3. install the mmcv separately.
  4. cd mmdetection and run ./compile.sh
  5. pip install .
    may be useful to u.

All 16 comments

It is possible that the compiling environment and runtime environment are not the same. You can have a check.

i also have this problem

It is possible that the compiling environment and runtime environment are not the same. You can have a check.

Thank you. That's the answer exactly. Be careful of compiling environment and runtime environment

@softmicro929
Would you please give more details on how to check the compiling environment and runtime environment? I met the same issue when running tools/test.py in a pytorch conda env. Thanks!

@qpanpony
there is a script for setting up mmdetection with conda for reference, i have solved my problem by refer to the script.
This is my own step to solve the problem:

  1. python 3.5 --> python=3.6
  2. conda install pytorch==0.4.1 --> conda install pytorch torchvision -c pytorch(use official source)
  3. install the mmcv separately.
  4. cd mmdetection and run ./compile.sh
  5. pip install .
    may be useful to u.

@mynameiziji it works for me

@mynameiziji
I wiped the slate clean and it works, though still be puzzled. Thank you!

sorry to re-open the thread.
what is the script @mynameiziji ? is that mentioned on bottom of INSTALL.md?
i can not open that address(https://gist.github.com/hellock/bf23cd7348c727d69d48682cb6909047)
anybody can suggest what content for the script. I met similar import issue when run the test.py.

from mmdet.models import build_detector
Traceback (most recent call last):

File "", line 1, in
from mmdet.models import build_detector

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/models/__init__.py", line 1, in
from .detectors import (BaseDetector, TwoStageDetector, RPN, FastRCNN,

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/models/detectors/__init__.py", line 1, in
from .base import BaseDetector

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/models/detectors/base.py", line 9, in
from mmdet.core import tensor2imgs, get_classes

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/core/__init__.py", line 6, in
from .post_processing import * # noqa: F401, F403

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/core/post_processing/__init__.py", line 1, in
from .bbox_nms import multiclass_nms

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/core/post_processing/bbox_nms.py", line 3, in
from mmdet.ops.nms import nms_wrapper

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/ops/__init__.py", line 1, in
from .nms import nms, soft_nms

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/ops/nms/__init__.py", line 1, in
from .nms_wrapper import nms, soft_nms

File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/ops/nms/nms_wrapper.py", line 4, in
from .gpu_nms import gpu_nms

ImportError: /home/ubuntu/anaconda3/lib/python3.7/site-packages/mmdet-0.5.4+cd35200-py3.7.egg/mmdet/ops/nms/gpu_nms.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __cudaPopCallConfiguration

thank you!

@ximitiejiang
it's the script:

conda create -n open-mmlab python=3.6 -y
source activate open-mmlab

conda install -c pytorch pytorch torchvision -y
conda install cython -y
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
./compile.sh
pip install . # "pip install -e ." for develop mode

mkdir data
ln -s $COCO_ROOT data

@mynameiziji
@open-mmlab/mmdetection

thank you for the reply!
i have solved the issue.

At 2018-12-20 14:21:35, "mynameiziji" notifications@github.com wrote:

@ximitiejiang
it's the script:

conda create -n open-mmlab python=3.6 -y
source activate open-mmlab

conda install -c pytorch pytorch torchvision -y
conda install cython -y
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
./compile.sh
pip install . # "pip install -e ." for develop mode

mkdir data
ln -s $COCO_ROOT data

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

pytorch 1.0 works for me.

I encountered this issue and tried quite a few times.
I find everything is fine when installing without cudatoolkit, but if I use the PyTorch official conda install command(with cudatoolkit=*.0), this issue just happens again and again.
So, I think it has nothing to do with 3-rd party mirrors like tsinghua, I doubt it is the cudatoolkit installed by conda causing the problem.

Wish to be helpful!

We should install pytorch from official source.
conda install -c pytorch pytorch torchvision -y

@mynameiziji @open-mmlab/mmdetection thank you for the reply! i have solved the issue. At 2018-12-20 14:21:35, "mynameiziji" notifications@github.com wrote: @ximitiejiang it's the script: conda create -n open-mmlab python=3.6 -y source activate open-mmlab conda install -c pytorch pytorch torchvision -y conda install cython -y git clone https://github.com/open-mmlab/mmdetection.git cd mmdetection ./compile.sh pip install . # "pip install -e ." for develop mode mkdir data ln -s $COCO_ROOT data — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
that works for me. My cuda is 9.1 ,when I use cudatoolkit=9.0, it corrupped, but when I use conda install -c pytorch pytorch torchvision -y. It will install cudatoolkit=10.0, and it worked.

i can not install pytorch and torchvision from conda in Sep 16th, so it is there any other solutions for this problem?

couldn’t find any code matching 'compile.sh' in open-mmlab/mmdetection
@mynameiziji

Was this page helpful?
0 / 5 - 0 ratings