PointRCNN icon indicating copy to clipboard operation
PointRCNN copied to clipboard

can not import iou3d_cuda

Open sybilWsybil opened this issue 5 years ago • 16 comments

Traceback (most recent call last): File "eval_rcnn.py", line 7, in from lib.net.point_rcnn import PointRCNN File "/export/work/CODE/pointnet_set/PointRCNN/tools/../lib/net/point_rcnn.py", line 3, in from lib.net.rpn import RPN File "/export/work/CODE/pointnet_set/PointRCNN/tools/../lib/net/rpn.py", line 4, in from lib.rpn.proposal_layer import ProposalLayer File "/export/work/CODE/pointnet_set/PointRCNN/tools/../lib/rpn/proposal_layer.py", line 6, in import lib.utils.iou3d.iou3d_utils as iou3d_utils File "/export/work/CODE/pointnet_set/PointRCNN/tools/../lib/utils/iou3d/iou3d_utils.py", line 2, in import iou3d_cuda ImportError: /home/anaconda3/envs/torch/lib/python3.6/site-packages/iou3d-0.0.0-py3.6-linux-x86_64.egg/iou3d_cuda.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKSs

sybilWsybil avatar Jun 03 '19 03:06 sybilWsybil

Please check your compiling log, maybe your gcc version is not enough (should be gcc-5.4+).

sshaoshuai avatar Jun 10 '19 16:06 sshaoshuai

Hello ,

this is output I get gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Still facing this issue

Please let me know which version of Anaconda, Python, pytorch, cuda, cudatoolkit, cudnn have you used

I create new python 3.6 conda env, then conda install pytorch torchvision cuda80 -c pytorch then while compiling it shows this issue @sshaoshuai

Manojbhat09 avatar Jun 10 '19 20:06 Manojbhat09

@sybilWsybil Hey I solved it by editing the torch cpp_extension.py

Refer to this: https://aur.archlinux.org/packages/python-apex-git/ Do the edit, remove all build dist egg __pycache files from Pointnet, iou3d and roipooling folders Then build again And evaluate.

Try it.

Manojbhat09 avatar Jun 10 '19 20:06 Manojbhat09

Please check your compiling log, maybe your gcc version is not enough (should be gcc-5.4+).

my gcc version is 5.4.0

sybilWsybil avatar Jun 12 '19 01:06 sybilWsybil

@sybilWsybil Hey I solved it by editing the torch cpp_extension.py

Refer to this: https://aur.archlinux.org/packages/python-apex-git/ Do the edit, remove all build dist egg __pycache files from Pointnet, iou3d and roipooling folders Then build again And evaluate.

Try it.

Is this a problem of pytorch's version? I don't want to change .py in pytorch,because my other may not run successfully

sybilWsybil avatar Jun 12 '19 01:06 sybilWsybil

@sybilWsybil @sshaoshuai

Hey, do you solve the problem now? I get the same problem and can not fix it (gcc 5.4.0 and ubuntu 16.04).

Thanks.

XBSong avatar Jun 27 '19 13:06 XBSong

@sybilWsybil @sshaoshuai

Hey, do you solve the problem now? I get the same problem and can not fix it (gcc 5.4.0 and ubuntu 16.04).

Thanks.

I have not fix it

sybilWsybil avatar Jul 04 '19 00:07 sybilWsybil

H. I have the same issue today, I solved modifying the build_and_install.sh forcing it to use python3 (in my case python 3.5.2) instead of python (it could be also solved changing the default python version on Ubuntu for me that would not be a solution). After that, it indicates some issues with some strings in the eval.py, correcting that it works.

jcmayoral avatar Jul 08 '19 11:07 jcmayoral

I sloved it by changing the setup.py under iou3d as below Note: If torch._C._GLIBCXX_USE_CXX11_ABI is True, it indicates your pytorch is compiled with using CXX11_ABI, so change '-D_GLIBCXX_USE_CXX11_ABI=0' to '-D_GLIBCXX_USE_CXX11_ABI=1' Furthermore, you must import torch before import iou3d_cuda

iou3d/setup.py

from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

setup(
    name='iou3d',
    ext_modules=[
        CUDAExtension('iou3d_cuda', [
            'src/iou3d.cpp',
            'src/iou3d_kernel.cu',
        ],
        extra_compile_args=['-D_GLIBCXX_USE_CXX11_ABI=0', '-std=c++11',{'nvcc': ['-O2']}])],
    cmdclass={'build_ext': BuildExtension}) 

reference:1

gongshichina avatar Jul 11 '19 07:07 gongshichina

I sloved it by changing the setup.py under iou3d as below Note: If torch._C._GLIBCXX_USE_CXX11_ABI is True, it indicates your pytorch is compiled with using CXX11_ABI, so change '-D_GLIBCXX_USE_CXX11_ABI=0' to '-D_GLIBCXX_USE_CXX11_ABI=1' Furthermore, you must import torch before import iou3d_cuda

iou3d/setup.py

from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

setup(
    name='iou3d',
    ext_modules=[
        CUDAExtension('iou3d_cuda', [
            'src/iou3d.cpp',
            'src/iou3d_kernel.cu',
        ],
        extra_compile_args=['-D_GLIBCXX_USE_CXX11_ABI=0', '-std=c++11',{'nvcc': ['-O2']}])],
    cmdclass={'build_ext': BuildExtension}) 

reference:1

Hello, I tried your method, but it didn't work. I don't know if it is because I already install a iou3d_cuda version before. And my gcc version is 4.8.4.

gujiaqivadin avatar Aug 25 '19 03:08 gujiaqivadin

I ran into the same problem, python version 3.6.2, cuda is 10.0, pytorch is 1.0.1, cudatoolkit is 10.0.130, cudnn is 7.6.4, gcc version 5.4.0. Is there a problem with my version?

qiaoli96 avatar Nov 09 '19 12:11 qiaoli96

thank you. I have spent serveral days to solve this problem.

qiaoli96 avatar Nov 09 '19 14:11 qiaoli96

I use python3.7 with pytorch 1.2.0 and the bug is fixed. cheers

triangleCZH avatar Nov 26 '19 03:11 triangleCZH

@sybilWsybil Hey I solved it by editing the torch cpp_extension.py

Refer to this: https://aur.archlinux.org/packages/python-apex-git/ Do the edit, remove all build dist egg __pycache files from Pointnet, iou3d and roipooling folders Then build again And evaluate.

Try it.

Hi please how do I build again?

jeffepok avatar Oct 23 '21 11:10 jeffepok

After trying for a whole afternoon,I conclude that you must import torch before import iou3d_cuda!

MSunDYY avatar Oct 07 '23 15:10 MSunDYY

我已收到您的邮件,谢谢!--李悄(^_^)

qiaoli96 avatar Oct 07 '23 15:10 qiaoli96