second.pytorch icon indicating copy to clipboard operation
second.pytorch copied to clipboard

cannot import name 'spconv_utils' from 'spconv'

Open Hunkzer opened this issue 5 years ago • 17 comments

Hello! I am currently trying to implement SECOND with PointPillars support.

I successfully installed spconv, but when I try to python create_data.py kitti_data_prep --data_path=KITTI_DATASET_ROOT, I get the following error:

$ python create_data.py kitti_data_prep --data_path=$KITTI_DATASET_ROOT Traceback (most recent call last):  File "create_data.py", line 7, in   import second.data.kitti_dataset as kitti_ds  File "/home/../SECOND_v1-5/second.pytorch/second/data/kitti_dataset.py", line 8, in   from second.core import box_np_ops  File "/home/../SECOND_v1-5/second.pytorch/second/core/box_np_ops.py", line 5, in   from spconv.utils import rbbox_iou, rbbox_intersection  File "/home/../SparseConvNet/spconv/spconv/init.py", line 20, in   from spconv import utils  File "/home/../SparseConvNet/spconv/spconv/utils/init.py", line 16, in   from spconv import spconv_utils ImportError: cannot import name 'spconv_utils' from 'spconv' (/home/../spconv/spconv/init.py)

Any help would be appreciated! ~Hunkzer

Hunkzer avatar Apr 10 '19 15:04 Hunkzer

the newest code already have pointpillars support. please use python setup.py bdist_wheel and cd ./dist && pip install xxx.whl to install spconv.

traveller59 avatar Apr 11 '19 03:04 traveller59

Hi traveller59,

thank you for your answer. I had no errors or warnings when installing spconv using the steps you mentioned.

Are there some files related to 'spconv_utils', which should be generated during the installation of spconv and may be missing? I remember there is a CMakeLists.txt file located somewhere in the /src/.. directory of spconv, which refers to 'spconv_utils' and it looked like this file is responsible for creating the spconv_utils subpackage.

I will try to get it working again in a few hours, but if you have any suggestions to fix this, please let me know :)

~Hunkzer

Hunkzer avatar Apr 11 '19 04:04 Hunkzer

Hi Hunkzer, kindly help me in this issue as im stuck in this error. Iam able to do succesfully

python setup.py bdist_wheel and cd ./dist && pip install xxx.whl

But ImportError: cannot import name 'spconv_utils' from 'spconv is coming error. Kindly do the needful

chowkamlee81 avatar Apr 19 '19 11:04 chowkamlee81

Hey,

unfortunately I stopped trying to fix the error and started to work with the PointPillars implementation instead. But I will reopen this issue so this error gets some more visibility since it's not only me who is having trouble getting this to work out of the box.

Please let me know if you manage to fix the error :D

Hunkzer avatar Apr 20 '19 11:04 Hunkzer

hi,

I'm also facing the same error "Importerror: cannot import name spconv_utils" Does any of you found a solution?

aacmi avatar Jul 22 '19 18:07 aacmi

i am also get this error.em, how to manage it

YiF-chen avatar Sep 02 '19 03:09 YiF-chen

i am also get this error.em, how to manage it

hey! Did you solve it? I met the same problem...

z393 avatar Sep 15 '19 13:09 z393

I met the same problem,too

songlilucky avatar Sep 18 '19 13:09 songlilucky

Same problem, even after python setup.py bdist_wheel and cd ./dist && pip install xxx.whl

Anyone found a fix for this?

tkasarla avatar Oct 18 '19 11:10 tkasarla

Same issue here. Installed per instructions, in the same CONDA environment as second, still ImportError: cannot import name 'spconv_utils' from 'spconv'

jacoblambert avatar Oct 23 '19 02:10 jacoblambert

I fixed this by adding: export PYTHONPATH=/path_to_repo/spconv/spconv/:$PYTHONPATH to my .bashrc file.

jacoblambert avatar Oct 30 '19 03:10 jacoblambert

i also meet this issue, even after python setup.py bdist_wheel and cd ./dist && pip install xxx.whl

ryontang avatar Apr 18 '20 08:04 ryontang

i also meet this issue, even after python setup.py bdist_wheel and cd ./dist && pip install xxx.whl I solved this problem with downloading the master branch of spconv, -> python setup.py bdist_wheel -> cd ./dist && pip install --force-reinstall xxx.whl

Jamie725 avatar Jun 17 '21 21:06 Jamie725

i got the same problem. does anyone know how to fix it?

i tried below solution but still not worked

I fixed this by adding: export PYTHONPATH=/path_to_repo/spconv/spconv/:$PYTHONPATH to my .bashrc file.

curiousboy20 avatar Sep 21 '21 22:09 curiousboy20

i also meet this issue, even after python setup.py bdist_wheel and cd ./dist && pip install xxx.whl I solved this problem with downloading the master branch of spconv, -> python setup.py bdist_wheel -> cd ./dist && pip install --force-reinstall xxx.whl

Hi, can you explain more about downloading the master branch? should i put the downloaded folder in certain place to make it works?

curiousboy20 avatar Sep 21 '21 22:09 curiousboy20

i got the same problem. does anyone know how to fix it?

i tried below solution but still not worked

I fixed this by adding: export PYTHONPATH=/path_to_repo/spconv/spconv/:$PYTHONPATH to my .bashrc file.

If spconv_utils.cpython-36m-x86_64-linux-gnu.so files(name of those files may vary minorly) are present in ~/spconv/build/lib.linux-x86_64-3.6/spconv/ or whatever relatable directory. You should add that directory into $PYTHONPATH env variable. If not, stop reading this because you have some other problem :(

When path to spconv automatically added to sys.path by python, appending path I mentioned to the end of paths list wont work out. Because python finds the wrong directory first, then somehow ignores the right path coming at the end added by you. So add your path by export PYTHONPATH="${PYTHONPATH}:/home/user/spconv/build/lib.linux-x86_64-3.6/spconv/" which will insert it as the first path in PYHTONPATH. At least this was how i solved my issue.

OrcunCanDeniz avatar Dec 29 '21 16:12 OrcunCanDeniz

thanks a lot!! I solved my problem following your instructions!!!!!!! ^v^

Kaisyouu avatar Mar 01 '22 09:03 Kaisyouu