traveller59 / spconv

Spatial Sparse Convolution Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModuleNotFoundError: Why does the installed spconv version 1.2.1 not have the Module spconv.core_cc?

swaggywilliam opened this issue · comments

I followed the "Install on Ubuntu 16.04/18.04" tutorial for spconv1.x installed spconv 1.2.1 from source, and as a result, the OpenPCDet demo.py fails to run properly. Here are the environment dependencies:

Package             Version       Editable project location
------------------- ------------- ----------------------------------
apptools            5.2.1
blessed             1.20.0
ccimport            0.4.2
certifi             2023.11.17
charset-normalizer  3.3.2
configobj           5.0.8
contourpy           1.1.1
cumm                0.4.11
cycler              0.12.1
easydict            1.11
envisage            7.0.3
fire                0.5.0
fonttools           4.46.0
gpustat             1.1
idna                3.6
imageio             2.33.0
importlib-metadata  7.0.0
importlib-resources 6.1.1
kiwisolver          1.4.5
lark                1.1.8
lazy_loader         0.3
llvmlite            0.41.1
matplotlib          3.7.4
mayavi              4.8.1
networkx            3.1
ninja               1.11.1.1
numba               0.58.1
numpy               1.24.4
nvidia-ml-py        11.525.112
opencv-python       4.8.1.78
packaging           23.2
pccm                0.4.11
pcdet               0.6.0+255db8f /home/project/OpenPCDet
Pillow              10.1.0
pip                 23.3.1
portalocker         2.8.2
protobuf            4.25.1
psutil              5.9.5
pybind11            2.11.1
pyface              8.0.0
Pygments            2.17.2
pyparsing           3.1.1
pyquaternion        0.9.9
python-dateutil     2.8.2
PyWavelets          1.4.1
PyYAML              6.0.1
requests            2.31.0
scikit-image        0.21.0
scipy               1.10.1
setuptools          68.0.0
SharedArray         3.2.3
six                 1.16.0
spconv              1.2.1
tensorboardX        2.6.2.2
termcolor           2.4.0
tifffile            2023.7.10
torch               1.8.1+cu111
torchaudio          0.8.1
torchvision         0.9.1+cu111
tqdm                4.66.1
traits              6.4.3
traitsui            8.0.0
typing_extensions   4.8.0
urllib3             2.1.0
vtk                 9.3.0
wcwidth             0.2.6
wheel               0.41.2
zipp                3.17.0

image
image

When I run the OpenPCDet demo using the command:

python demo.py --cfg_file /home/project/OpenPCDet/tools/cfgs/kitti_models/voxel_rcnn_car_focal_multimodal.yaml --data_path /public/kitti/training/velodyne_reduced/000008.bin --ckpt /home/project/ckpt/voxel_rcnn_car_84.54.pth

AttributeError

AttributeError: module 'spconv' has no attribute 'SparseModule'

Referring to the solutions for spconv2.x in the issues, I modified import spconv to import spconv.pytorch as spconv in order to address the problem.
It's indeed puzzling that errors related to spconv2.x are appearing when I've installed spconv1.x. Additionally, while this workaround resolves the issue, it introduces new problems:

ModuleNotFoundError: No module named 'spconv.core_cc'

By comparing the installation paths of spconv2.x, it became evident that there is a directory named 'core.' However, in the case of spconv1.2.1 installed from source code, the 'core' directory is missing. Consequently, I attempted to copy the 'core' directory from spconv2.x to the path of spconv1.2.1. Nevertheless, this resulted in another error:

ImportError: cannot import name 'SpconvOps' from 'spconv.core_cc.csrc.sparse.all' (unknown location)

However, the 'core' directory I copied over includes 'csrc.sparse.all,' and I'm puzzled as to why it's still throwing an error with an "unknown location." I'm eager to know the correct procedure for installing spconv1.2.1. Could you please assist me? Thank you!

update:
someone told me that my spconv1.2.1 didn't have the directory 'core' because I installed with a wrong .whl. But I was not entangled with it anymore and installed spconv2.1 instead.