drprojects / DeepViewAgg

[CVPR'22 Best Paper Finalist] Official PyTorch implementation of the method presented in "Learning Multi-View Aggregation In the Wild for Large-Scale 3D Semantic Segmentation"
Other
222 stars 24 forks source link

ModuleNotFoundError: No module named 'libKeOpstorch4381e0bfc3' #7

Closed pengsongyou closed 2 years ago

pengsongyou commented 2 years ago

Hi @drprojects, first of all, thanks a lot for the great work!!!

I am currently playing with notebooks/synthetic_multimodal_dataset.ipynb and notebooks/kitti360_visualization.ipynb and encountered the same errors. In notebooks/synthetic_multimodal_dataset.ipynb, the error comes from the first cell under "Project 3D Data onto ImageData to generate mappings"

from torch_points3d.core.data_transform.multimodal.image import *

r_max = 10                        # maximum point-camera distance for the mappings
r_min = 0.2                       # minimum point-camera distance for the mappings 
k_list = [50]                     # number of neighbors used for neighborhood-based mapping features (eg density, occlusion)
exact = True                      # False: points are mapped to their whole z-buffering patch (denser mapping). True: only to the center (more accurate mapping)  
use_cuda = False                  # whether to use cuda to accelerate mapping computation
camera = 's3dis_equirectangular'  # camera model used (keep s3dis_equirectangular for this notebook)

data_list, image_data_list = MapImages(r_min=r_min, r_max=r_max, exact=exact, use_cuda=use_cuda, camera=camera)(data_list, image_data_list)
# image_data_list[0].mappings.features = None  # uncomment to visualize only densities and occlusions
data_list, image_data_list = NeighborhoodBasedMappingFeatures(k=k_list, voxel=voxel, density=True, occlusion=True, use_faiss=False, use_cuda=use_cuda)(data_list, image_data_list)

And the errors are coming from the last line:

Output exceeds the [size limit](command:workbench.action.openSettings?[%22notebook.output.textLineLimit%22]). Open the full output data[ in a text editor](command:workbench.action.openLargeOutput?410ce9c8-0625-4e9a-92f6-2c93931cec62)
Compiling libKeOpstorch4381e0bfc3 in /home/songyou/.cache/pykeops-1.4.2-cpython-37:
       formula: ArgKMin_Reduction(Sum(Square((Var(0,3,0) - Var(1,3,1)))),50,0)
       aliases: Var(0,3,0); Var(1,3,1); 
       dtype  : float32
... 
--------------------- CMAKE DEBUG -----------------
Command '['cmake', '/home/songyou/anaconda3/envs/deep_view_aggregation/lib/python3.7/site-packages/pykeops', "-DCMAKE_BUILD_TYPE='Release'", "-DFORMULA_OBJ='ArgKMin_Reduction(Sum(Square((Var(0,3,0) - Var(1,3,1)))),50,0)'", "-DVAR_ALIASES=''", "-Dshared_obj_name='libKeOpstorch4381e0bfc3'", "-D__TYPE__='float'", "-DPYTHON_LANG='torch'", "-DPYTHON_EXECUTABLE='/home/songyou/anaconda3/envs/deep_view_aggregation/bin/python'", "-DPYBIND11_PYTHON_VERSION='3.7'", '-DC_CONTIGUOUS=1', '-D__TYPEACC__=float', '-DENABLECHUNK=1', '-DPYTORCH_ROOT_DIR=/home/songyou/anaconda3/envs/deep_view_aggregation/lib/python3.7/site-packages/torch', '-D_GLIBCXX_USE_CXX11_ABI=0', "-DcommandLine=cmake /home/songyou/anaconda3/envs/deep_view_aggregation/lib/python3.7/site-packages/pykeops -DCMAKE_BUILD_TYPE='Release' -DFORMULA_OBJ='ArgKMin_Reduction(Sum(Square((Var(0,3,0) - Var(1,3,1)))),50,0)' -DVAR_ALIASES='' -Dshared_obj_name='libKeOpstorch4381e0bfc3' -D__TYPE__='float' -DPYTHON_LANG='torch' -DPYTHON_EXECUTABLE='/home/songyou/anaconda3/envs/deep_view_aggregation/bin/python' -DPYBIND11_PYTHON_VERSION='3.7' -DC_CONTIGUOUS=1 -D__TYPEACC__=float -DENABLECHUNK=1 -DPYTORCH_ROOT_DIR=/home/songyou/anaconda3/envs/deep_view_aggregation/lib/python3.7/site-packages/torch -D_GLIBCXX_USE_CXX11_ABI=0"]' returned non-zero exit status 1.
-- The CUDA Host CXX Compiler: /usr/bin/c++
-- Compute properties automatically set to: -DMAXIDGPU=1;-DMAXTHREADSPERBLOCK0=1024;-DSHAREDMEMPERBLOCK0=49152;-DMAXTHREADSPERBLOCK1=1024;-DSHAREDMEMPERBLOCK1=49152
-- Autodetected CUDA architecture(s):  8.0 8.0
-- Using shared_obj_name: libKeOpstorch4381e0bfc3
-- First i variables detected is 0
-- First j variables detected is 1
-- Compiled formula is ArgKMin_Reduction(Sum(Square((Var(0,3,0) - Var(1,3,1)))),50,0);  where the number of args is 2.
-- pybind11 v2.6.1 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/songyou/.cache/pykeops-1.4.2-cpython-37/build-libKeOpstorch4381e0bfc3

--------------------- ----------- -----------------

--------------------- MAKE DEBUG -----------------
Command '['cmake', '--build', '.', '--target', 'libKeOpstorch4381e0bfc3', '--', 'VERBOSE=1']' returned non-zero exit status 2.
/usr/bin/cmake -S/home/songyou/anaconda3/envs/deep_view_aggregation/lib/python3.7/site-packages/pykeops -B/home/songyou/.cache/pykeops-1.4.2-cpython-37/build-libKeOpstorch4381e0bfc3 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make -f CMakeFiles/Makefile2 libKeOpstorch4381e0bfc3
...
make[1]: Leaving directory '/home/songyou/.cache/pykeops-1.4.2-cpython-37/build-libKeOpstorch4381e0bfc3'

--------------------- ----------- -----------------
Done.
Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?4a21863a-d4ef-44fc-9851-d5c611e3cb64)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-7-1f2d3c55a1c4> in <module>
     10 data_list, image_data_list = MapImages(r_min=r_min, r_max=r_max, exact=exact, use_cuda=use_cuda, camera=camera)(data_list, image_data_list)
     11 # image_data_list[0].mappings.features = None  # uncomment to visualize only densities and occlusions
---> 12 data_list, image_data_list = NeighborhoodBasedMappingFeatures(k=k_list, voxel=voxel, density=True, occlusion=True, use_faiss=False, use_cuda=use_cuda)(data_list, image_data_list)

~/workspace/DeepViewAgg/torch_points3d/core/data_transform/multimodal/image.py in __call__(self, data, images)
     43                 f"List(Data) items and List(SameSettingImageData) must " \
     44                 f"have the same lengths."
---> 45             out = [self.__call__(da, im) for da, im in zip(data, images)]
     46             data_out, images_out = [list(x) for x in zip(*out)]
     47         elif isinstance(images, ImageData) and not self._PROCESS_IMAGE_DATA:

~/workspace/DeepViewAgg/torch_points3d/core/data_transform/multimodal/image.py in <listcomp>(.0)
     43                 f"List(Data) items and List(SameSettingImageData) must " \
     44                 f"have the same lengths."
---> 45             out = [self.__call__(da, im) for da, im in zip(data, images)]
     46             data_out, images_out = [list(x) for x in zip(*out)]
     47         elif isinstance(images, ImageData) and not self._PROCESS_IMAGE_DATA:

~/workspace/DeepViewAgg/torch_points3d/core/data_transform/multimodal/image.py in __call__(self, data, images)
     54                 images = ImageData([images])
     55             # data_out, images_out = self._process(data.clone(), images.clone())
---> 56             data_out, images_out = self._process(data, images)
...
~/anaconda3/envs/deep_view_aggregation/lib/python3.7/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda3/envs/deep_view_aggregation/lib/python3.7/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

ModuleNotFoundError: No module named 'libKeOpstorch4381e0bfc3'

Next, the same errors also happened in the kitti360_visualization.ipynb in this cell where processing the dataset:

# Dataset instantiation
start = time()
dataset = KITTI360DatasetMM(cfg.data)
# print(dataset)
print(f"Time = {time() - start:0.1f} sec.")

It seems to me that the error is coming from the data processing step, but I am not sure how to solve this. Could you please provide some advice on how I can solve this issue? Thanks so much in advance!

Best Songyou

drprojects commented 2 years ago

Hi Songyou,

Thanks for using this project !

This error is related to the pykeops library, that I use for NN search on the CPU. The error you have is that pykeops fails to compile the NN search kernel.

Just to be sure: have you installed the project using the insall.sh script, without any modifications ? I can see in the error log that you seem to have the proper pykeops==1.4.2 installed, but does your environment also have cuda >= 10.1 and gcc >= 7 ? Can you please share which versions you are using ?

Best, Damien

drprojects commented 2 years ago

Some resources to test and debug your pykeops installation:

Please let me know how this goes and if it solves your problem !

Damien

pengsongyou commented 2 years ago

Hi Songyou,

Thanks for using this project !

This error is related to the pykeops library, that I use for NN search on the CPU. The error you have is that pykeops fails to compile the NN search kernel.

Just to be sure: have you installed the project using the insall.sh script, without any modifications ? I can see in the error log that you seem to have the proper pykeops==1.4.2 installed, but does your environment also have cuda >= 10.1 and gcc >= 7 ? Can you please share which versions you are using ?

Best, Damien

Hi Damien,

Thanks for your rapid response! Yes indeed, I installed the project using the install.sh script without any modifications. The only thing that I needed to reinstall myself is the MinkowskiEngine. If I specify it as 0.4.3, it threw errors, so I instead installed it without the version and it compiled successfully. I will test the resources later today and share to you!

Best Songyou

drprojects commented 2 years ago

Hi again,

OK, strange for MinkowskiEngine, I don't think you will have downstream problems with this and I don't think it is related to the problem at hand.

I encountered similar errors when deploying the project on some machines and I solved it by manual CUDA/gcc versions management. Let me know how that goes ! ;)

Best Damien

pengsongyou commented 2 years ago

Hi again!

So I got the same errors from resource that you sent, it gave the same error. Therefor, I uninstalled the current pykeops and reinstalled it without specifying the version pip install pykeops, and now it works! I still don't know what exactly the problem was though, but I will close the issue for now.

Thanks again for your great help!

Best Songyou