Lidar_AI_Solution
Lidar_AI_Solution copied to clipboard
SparseConv2d and SubMConv2d support
Hi, thanks for the great work.
I have used some spconv 2d layers in my network. I read your code, I see that the 3D versions are all converted to 'SparseConvolution' onnx node and will be parsed and used in spconv engine during inference. I wonder if the engine or libspconv also compatialbe with the sparse 2D versions? I can also convert the 2d versions to 'SparseConvolution' onnx node?
thanks!
The 2d SPCONV is a specific form of 3d SPCONV. You just set z to 1 at indices which can achieve the 2d SPCONV.
Thanks for the reply. I will covert some parameters of SPCONV2D to suit the 'SparseConvlution' parameters.
@HuangVictorAuto Hi! can you explain how did you convert it if you already did? thanks!
@AhmedNasr7 , just as above mentioned, 2d sparsconv is just a special case for 3d sparseconv, just set z dimension to 1. you can update your pytorch network from 2d to 3d first, and then do the onnx export.
I guess this requires re-training the network, no out of the box solutions for pretrained models?
I manage to load a pretrained model, update the 2d spconvs to 3d spconv weights and bias accordingly to suit the libspconv 'sparseconvlution'.
@hopef , I manage to convert the 2d sparseconv/submanifold to 3d, by two methods, update the weights and shapes during the onnx node create stage. And I also update the pytorch model from 2d to 3d and then covert to onnx.
But both method, I found that the result of sparseconv2d is aligned between pytorch and engine. But the result from submanifold 2d is not aligned. Have you test the libspconv submanifold3d (with special case z=1 ) situation?
following is my onnx, I checked node 1 output, result is ok. node 2 output, result is not OK.
@HuangVictorAuto could you give me a reproduce data? For example a simple pytorch code and a simple input data(features, indices, grid_size).
Hi, attached file is a short sample for subm2d network. please check it. I found big difference between the pytorch and engine result, just for 1 subm2d node. could you please help check whether there is bug during my 2d sparse submanifold to 3d sparse submanifold or there is some bug inside the engine? Thanks! subm2d.zip