NVIDIA / MinkowskiEngine

Minkowski Engine is an auto-diff neural network library for high-dimensional sparse tensors
https://nvidia.github.io/MinkowskiEngine
Other
2.47k stars 367 forks source link

Question about function stride_map() #440

Open wenh19 opened 2 years ago

wenh19 commented 2 years ago

Hello, thank you for this amazing work!

I want to get the mapping between SparseTensors. Firstly I tried get_coords_map(), but soon learned it had been renamed to stride_map() from #348. However, I still failed when coded as:

from MinkowskiEngine.MinkowskiCoordinateManager import CoordinateManager as coordman
x, y = coordman.stride_map(sp_tensor.coordinate_map_key,
                           out_sp_tensor.coordinate_map_key)

where sp_tensor and out_sp_tensor are both SparseTensor. Specifically out_sp_tensor = stride_2_conv(sp_tensor),'stride_2_conv()' is a conv block stride 2. The exception:

Exception has occurred: RuntimeError
/tmp/pip-install-4apeg4u1/minkowskiengine_85122bb6deb74f3caf7ff592814b472f/src/coordinate_map_manager.cpp:988, assertion (exists(p_in_map_key)) failed. 
CoordinateMap not found
  File "XXX", line 27, in <module>
    x, y = coordman.stride_map(sp_tensor.coordinate_map_key,

Im confused about error CoordinateMap not found, can you please tell me what's wrong with it and what's the right way to get the mapping index between SparseTensors with different stides? My Mink version is v 0.5.4 Thank you so much!

yhyang-myron commented 1 year ago

Hi, have you solved this problem?