sshaoshuai / PointRCNN

PointRCNN: 3D Object Proposal Generation and Detection from Point Cloud, CVPR 2019.
MIT License
1.73k stars 425 forks source link

can not import iou3d_cuda #57

Open sybilWsybil opened 5 years ago

sybilWsybil commented 5 years ago

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

sshaoshuai commented 5 years ago

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

Manojbhat09 commented 5 years ago

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 commented 5 years ago

@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.

sybilWsybil commented 5 years ago

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 commented 5 years ago

@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

XBSong commented 5 years ago

@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.

sybilWsybil commented 5 years ago

@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

jcmayoral commented 5 years ago

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.

gongshichina commented 5 years ago

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

gujiaqivadin commented 5 years ago

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.

qiaoli96 commented 5 years ago

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 commented 5 years ago

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

triangleCZH commented 5 years ago

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

jeffepok commented 3 years ago

@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?

MSunDYY commented 1 year ago

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

qiaoli96 commented 1 year ago

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