I can not import 'deform_conv_cuda'
abing222 opened this issue · 25 comments
File "/home/abing/anaconda3/lib/python3.6/site-packages/mmdet-0.6rc0+85c30cc-py3.6.egg/mmdet/ops/dcn/functions/deform_conv.py", line 5, in
from .. import deform_conv_cuda
This is a long time ago, it seems that the environment variable problem, or compile problem, I only changed the two places
This is a long time ago, it seems that the environment variable problem, or compile problem, I only changed the two places
sorry but now I'm also troubled by this issue:
`>>> from mmdet.models import build_detector
Traceback (most recent call last):
File "", line 1, in
File "/home/liu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6rc0+unknown-py3.6.egg/mmdet/models/init.py", line 1, in
from .backbones import * # noqa: F401,F403
File "/home/liu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6rc0+unknown-py3.6.egg/mmdet/models/backbones/init.py", line 1, in
from .resnet import ResNet
File "/home/liu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6rc0+unknown-py3.6.egg/mmdet/models/backbones/resnet.py", line 9, in
from mmdet.ops import DeformConv, ModulatedDeformConv
File "/home/liu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6rc0+unknown-py3.6.egg/mmdet/ops/init.py", line 1, in
from .dcn import (DeformConv, DeformRoIPooling, DeformRoIPoolingPack,
File "/home/liu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6rc0+unknown-py3.6.egg/mmdet/ops/dcn/init.py", line 1, in
from .functions.deform_conv import deform_conv, modulated_deform_conv
File "/home/liu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6rc0+unknown-py3.6.egg/mmdet/ops/dcn/functions/deform_conv.py", line 5, in
from .. import deform_conv_cuda
ImportError: /home/liu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6rc0+unknown-py3.6.egg/mmdet/ops/dcn/deform_conv_cuda.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKSs`
I check the code of mmdet/ops/dcn/functions/deform_conv.py,and
from .. import deform_conv_cuda
in this file ,I can't find a source of deform_conv_cuda.
This problem has troubled me for three days, and I can not debug through the demo.Could you give some suggestions?thanks.
I meet the same problem. Have anyone checked it out?
@Smoothing97,@ abing222 ,@Sun-Fan
Thanks
@Baby47 简单回复:
不知道你是否解决了问题,我尝试过重新编译、重新安装conda环境,对这个问题意义不大。但是我将项目文件拷贝到/home/liu/mmdetection/里,重新编译,没有报错。因此是玄学问题:)如果你还需要帮助,可以回复我:)
you can simply change the folder name of mmdet to other names. Since the deform_conv_cuda should be referred to the one in the path /usr/local/lib/python3.5/dist-packages/mmdet-0.5.7+unknown-py3.5.egg/mmdet/ops/dcn/deform_conv_cuda.cpython-35m-x86_64-linux-gnu.so, but here the same folder "mmdet" in your current project direction confused the system. To me, just change that folder name solved the problems well.
same problem with pytorch-0.4.1
you can simply change the folder name of mmdet to other names. Since the deform_conv_cuda should be referred to the one in the path /usr/local/lib/python3.5/dist-packages/mmdet-0.5.7+unknown-py3.5.egg/mmdet/ops/dcn/deform_conv_cuda.cpython-35m-x86_64-linux-gnu.so, but here the same folder "mmdet" in your current project direction confused the system. To me, just change that folder name solved the problems well.
hi,i have the same problem
Your answer is very helpful to me, but I don't quite understand how to do it.
you can simply change the folder name of mmdet to other names. Since the deform_conv_cuda should be referred to the one in the path /usr/local/lib/python3.5/dist-packages/mmdet-0.5.7+unknown-py3.5.egg/mmdet/ops/dcn/deform_conv_cuda.cpython-35m-x86_64-linux-gnu.so, but here the same folder "mmdet" in your current project direction confused the system. To me, just change that folder name solved the problems well.
I changed the file name of mmdet to mmdet1, but the same error still occurs.
File "demo.py", line 1, in
from mmdet.apis import init_detector, inference_detector, show_result
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/apis/init.py", line 2, in
from .train import train_detector
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/apis/train.py", line 10, in
from mmdet import datasets
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/datasets/init.py", line 1, in
from .custom import CustomDataset
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/datasets/custom.py", line 11, in
from .extra_aug import ExtraAugmentation
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/datasets/extra_aug.py", line 5, in
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/core/init.py", line 5, in
from .post_processing import * # noqa: F401, F403
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/core/post_processing/init.py", line 1, in
from .bbox_nms import multiclass_nms
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/core/post_processing/bbox_nms.py", line 3, in
from mmdet.ops.nms import nms_wrapper
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/ops/init.py", line 1, in
from .dcn import (DeformConv, DeformConvPack, ModulatedDeformConv,
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/ops/dcn/init.py", line 1, in
from .functions.deform_conv import deform_conv, modulated_deform_conv
File "/home/xinyu/anaconda3/envs/mmdetection/lib/python3.6/site-packages/mmdet-0.6.0+dc341cb-py3.6.egg/mmdet/ops/dcn/functions/deform_conv.py", line 5, in
from .. import deform_conv_cuda
ImportError: cannot import name 'deform_conv_cuda'
@Baby47 简单回复:
不知道你是否解决了问题,我尝试过重新编译、重新安装conda环境,对这个问题意义不大。但是我将项目文件拷贝到/home/liu/mmdetection/里,重新编译,没有报错。因此是玄学问题:)如果你还需要帮助,可以回复我:)
hi,i have the same problem
Your answer is very helpful to me, but I don't quite understand how to do it.
thank you very much can you leave you email address发自我的iPhone------------------ Original ------------------From: nuist-xinyu notifications@github.comDate: Tue,Jun 18,2019 7:20 PMTo: open-mmlab/mmdetection mmdetection@noreply.github.comCc: Baby47 18627856635@163.com, Mention mention@noreply.github.comSubject: Re: [open-mmlab/mmdetection] I can not import 'deform_conv_cuda'(#413) @Baby47 简单回复: 不知道你是否解决了问题,我尝试过重新编译、重新安装conda环境,对这个问题意义不大。但是我将项目文件拷贝到/home/liu/mmdetection/里,重新编译,没有报错。因此是玄学问题:)如果你还需要帮助,可以回复我:) hi,i have the same problem Your answer is very helpful to me, but I don't quite understand how to do it. —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "#413?email_source=notifications\u0026email_token=AFOF3SH54HLW6CINUI3XRRLP3DAHRA5CNFSM4G7F73NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX6BWQY#issuecomment-503061315", "url": "#413?email_source=notifications\u0026email_token=AFOF3SH54HLW6CINUI3XRRLP3DAHRA5CNFSM4G7F73NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX6BWQY#issuecomment-503061315", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
my email is 626673305@qq,com
thank you very much can you leave you email address发自我的iPhone------------------ Original ------------------From: nuist-xinyu notifications@github.comDate: Tue,Jun 18,2019 7:20 PMTo: open-mmlab/mmdetection mmdetection@noreply.github.comCc: Baby47 18627856635@163.com, Mention mention@noreply.github.comSubject: Re: [open-mmlab/mmdetection] I can not import 'deform_conv_cuda'(#413) @Baby47 简单回复: 不知道你是否解决了问题,我尝试过重新编译、重新安装conda环境,对这个问题意义不大。但是我将项目文件拷贝到/home/liu/mmdetection/里,重新编译,没有报错。因此是玄学问题:)如果你还需要帮助,可以回复我:) hi,i have the same problem Your answer is very helpful to me, but I don't quite understand how to do it. —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "#413?email_source=notifications\u0026email_token=AFOF3SH54HLW6CINUI3XRRLP3DAHRA5CNFSM4G7F73NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX6BWQY#issuecomment-503061315", "url": "#413?email_source=notifications\u0026email_token=AFOF3SH54HLW6CINUI3XRRLP3DAHRA5CNFSM4G7F73NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX6BWQY#issuecomment-503061315", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
Traceback (most recent call last):
File "demo.py", line 1, in
from mmdet.apis import init_detector, inference_detector, show_result
File "/home/xinyu/mmdetection/mmdet/apis/init.py", line 2, in
from .train import train_detector
File "/home/xinyu/mmdetection/mmdet/apis/train.py", line 10, in
from mmdet import datasets
File "/home/xinyu/mmdetection/mmdet/datasets/init.py", line 1, in
from .custom import CustomDataset
File "/home/xinyu/mmdetection/mmdet/datasets/custom.py", line 11, in
from .extra_aug import ExtraAugmentation
File "/home/xinyu/mmdetection/mmdet/datasets/extra_aug.py", line 5, in
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
File "/home/xinyu/mmdetection/mmdet/core/init.py", line 5, in
from .post_processing import * # noqa: F401, F403
File "/home/xinyu/mmdetection/mmdet/core/post_processing/init.py", line 1, in
from .bbox_nms import multiclass_nms
File "/home/xinyu/mmdetection/mmdet/core/post_processing/bbox_nms.py", line 3, in
from mmdet.ops.nms import nms_wrapper
File "/home/xinyu/mmdetection/mmdet/ops/init.py", line 1, in
from .dcn import (DeformConv, DeformConvPack, ModulatedDeformConv,
File "/home/xinyu/mmdetection/mmdet/ops/dcn/init.py", line 1, in
from .functions.deform_conv import deform_conv, modulated_deform_conv
File "/home/xinyu/mmdetection/mmdet/ops/dcn/functions/deform_conv.py", line 5, in
from .. import deform_conv_cuda
ImportError: /home/xinyu/mmdetection/mmdet/ops/dcn/deform_conv_cuda.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19UndefinedTensorImpl10_singletonE
hi,good morning,Do you have this problem?
Hi, did you solve the problem?
check your LD_LIBRARY_PATH, it should point to /usr/local/cuda/lib64
to check LD_LIBRARY_PATH use echo $LD_LIBRARY_PATH
if not set to this location manually update in .bashrc. Add this line export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
, if using pycharm add path to run config. This should solve this issue
same problem
遇到问题如下,试过好多方法都没解决!
Traceback (most recent call last):
File "test.py", line 2, in
from mmdet.apis import init_detector, inference_detector, show_result
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/apis/init.py", line 2, in
from .train import train_detector
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/apis/train.py", line 10, in
from mmdet import datasets
File "/home/dlg/VSST/Tianchi/mmdetection/mmdet/datasets/init.py", line 1, in
from .custom import CustomDataset
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/datasets/custom.py", line 12, in
from .extra_aug import ExtraAugmentation
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/datasets/extra_aug.py", line 5, in
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/core/init.py", line 6, in
from .post_processing import * # noqa: F401, F403
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/core/post_processing/init.py", line 1, in
from .bbox_nms import multiclass_nms
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/core/post_processing/bbox_nms.py", line 3, in
from mmdet.ops.nms import nms_wrapper
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/ops/init.py", line 1, in
from .dcn import (DeformConv, DeformConvPack, ModulatedDeformConv,
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/ops/dcn/init.py", line 1, in
from .functions.deform_conv import deform_conv, modulated_deform_conv
File "/home/dgl/VSST/Tianchi/mmdetection/mmdet/ops/dcn/functions/deform_conv.py", line 5, in
from .. import deform_conv_cuda
ImportError: cannot import name 'deform_conv_cuda'
Anyone can give me some advice?
@wdd233 这是由于mmdetection版本问题, 之前的版本安装方法是python setup.py develop
, 再./compile.sh
, 新的版本里去掉了这种方式, 改为
Implement all extension building in main setup.py.
因此这个问题有两种解决方法:
- 仍然使用之前的版本, 执行./compile.sh
- 拉取新版本, 重新编译(直接执行
python setup.py develop
)
If someone is working on colab, running the following has solved this issue for me:
!python setup.py develop
I am getting the same error on Google Colab. Did the
compile.sh
!python setup.py develop
!python3 setup.py develop
All the above commands ran successfully, but the error didn't resolve?
@Baby47 简单回复:
不知道你是否解决了问题,我尝试过重新编译、重新安装conda环境,对这个问题意义不大。但是我将项目文件拷贝到/home/liu/mmdetection/里,重新编译,没有报错。因此是玄学问题:)如果你还需要帮助,可以回复我:)
您好!
请问拷给的项目文件是整个mmdetection文件夹里的所有子文件吗?
Steps to resolve the problem:
-
Use the correct mmdetection source code https://github.com/open-mmlab/mmdetection. There are many versions of mmdetection on github, and I was using the wrong one.
-
Make sure that GPU runtime is selected on Google colab.
-
Verify the output of compile.sh. If it contains something related to .so file generation at the end of the output, then you are good.
-
Run the setup.py develop command.
These steps should resolve the issue.
Steps to resolve the problem:
- Use the correct mmdetection source code https://github.com/open-mmlab/mmdetection. There are many versions of mmdetection on github, and I was using the wrong one.
- Make sure that GPU runtime is selected on Google colab.
- Verify the output of compile.sh. If it contains something related to .so file generation at the end of the output, then you are good.
- Run the setup.py develop command.
These steps should resolve the issue.
yes, i believe this problem can be solved after follow your steps, but i can't find the "compile.sh" file, would u mind tell me where can i get this file?
I try another ways.
In the tutorial, setup the docker ,and from docker copy the /mmdection to the host.I guess maybe something wrong happen when we setup the mmdection leads to lack of some files.
sudo docker container cp -a d2dec54610bd:/mmdetection /home/usr
不知道你是否解决了问题,我尝试过重新编译、重新安装conda环境,对这个问题意义不大。但是我将项目文件拷贝到/home/liu/mmdetection/里,重新编译,没有报错。因此是玄学问题:)如果你还需要帮助,可以回复我:)
Hi I have created conda env with (1. conda install pytorch=1.1 cudatoolkit=10.0 torchvision -c pytorch 2. install mmcv 0.2.10, 3. mmdet 0.6.0+53c647e ). The given environment is created based on my project work. I have pasted the error below could you please help me. Best regards.