ethnhe / PVN3D

Code for "PVN3D: A Deep Point-wise 3D Keypoints Hough Voting Network for 6DoF Pose Estimation", CVPR 2020
MIT License
488 stars 105 forks source link

ImportError: cannot import name '_ext' from 'pvn3d.lib.pointnet2_utils' #47

Closed WW-0 closed 3 years ago

WW-0 commented 3 years ago

File "/home/cvzw/wym_ssh/PVN3D/pvn3d/lib/pointnet2_utils/pointnet2_utils.py", line 20, in from pvn3d.lib.pointnet2_utils import _ext ImportError: cannot import name '_ext' from 'pvn3d.lib.pointnet2_utils' (/home/cvzw/wym_ssh/PVN3D/pvn3d/lib/pointnet2_utils/init.py)

请问这个问题怎么解决,pytorch1.5版本的代码里的

opr-sergey commented 3 years ago

I have the same problem

opr-sergey commented 3 years ago

@WW-0 solved this problem: before install Pointnet2_PyTorch, you will need setup torch==1.4.0 and torchvision==0.5.0, then worked for me

opr-sergey commented 3 years ago

but after installation torch==1.4.0 not working CyclicLR from lib.utils.warmup_scheduler.py.

chaiban commented 3 years ago

Hi @opr-sergey , @WW-0 ,

Did you manage to solve this issue ?

I am getting same error using Torch 1.5. Thank you!

WW-0 commented 3 years ago

Hi @opr-sergey , @WW-0 , Did you manage to solve this issue ? I am getting same error using Torch 1.5. Thank you!

I can't find the original answer in an issues. Refer to this link: https://github.com/erikwijmans/Pointnet2_PyTorch/blob/master/pointnet2_ops_lib/pointnet2_ops/pointnet2_utils.py Change to the following code:

`try: 

    import pointnet2_ops._ext as _ext  

except ImportError:  

    from torch.utils.cpp_extension import load  

    import glob  

    import os.path as osp  

    import os`

now i can train without error, but i don't know if there will be any other problems.

chaiban commented 3 years ago

Thank you