Cylinder3D icon indicating copy to clipboard operation
Cylinder3D copied to clipboard

spconv 2.1.6 error shape in SubMConv3d

Open FuzhiYang opened this issue 3 years ago • 9 comments

I used spconv 2.1.6 and make necessary changes refered in link.

However, an error occured in SubMConv3d in conv3x3 in segmentator_3d_asymm_spconv.py. The detailed error information is as below:

train_cylinder_asym.py Namespace(config_path='config/semantickitti.yaml') [480 360 32] 0%| | 0/1000 [00:00<?, ?it/s]Traceback (most recent call last): File "train_cylinder_asym.py", line 167, in main(args) File "train_cylinder_asym.py", line 132, in main outputs = my_model(train_pt_fea_ten, train_vox_ten, train_batch_size) File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/yangfuzhi/code/Cylinder3D/network/cylinder_spconv_3d.py", line 44, in forward spatial_features = self.cylinder_3d_spconv_seg(features_3d, coords, batch_size) File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/yangfuzhi/code/Cylinder3D/network/segmentator_3d_asymm_spconv.py", line 296, in forward up4e = self.upBlock0(down4c, down4b) File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/yangfuzhi/code/Cylinder3D/network/segmentator_3d_asymm_spconv.py", line 208, in forward upE = self.conv3(upE) File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/spconv/pytorch/conv.py", line 411, in forward out_features = Fsp.implicit_gemm( File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 213, in decorate_fwd return fwd(*args, **kwargs) File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/spconv/pytorch/functional.py", line 133, in forward out, mask_out, mask_width = ops.implicit_gemm(features, filters, File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/spconv/pytorch/ops.py", line 1156, in implicit_gemm CONV.run_with_tuned_result( File "/home/yangfuzhi/anaconda3/envs/cylinder3d/lib/python3.8/site-packages/spconv/algo.py", line 724, in run_with_tuned_result ConvMainUnitTest.implicit_gemm2(params) ValueError: /tmp/pip-build-env-unsjr5kh/overlay/lib/python3.8/site-packages/cumm/include/tensorview/check.h(32) shape_ten[i] == shape[i] assert faild. error shape [9, 5663] expect [27, -1] 0%| | 0/1000 [00:12<?, ?it/s]

Have you met this error before? Do you know how to solve it?

FuzhiYang avatar Nov 18 '21 03:11 FuzhiYang

It might be a difference of spconv version; I used spconv==1.2.1, and it is better to keep its version consistent;

I do not try it with spconv==2.1.6; It seems a huge advance compared to 1.x.x;

So, can you try spconv==1.2.1? and give the detailed logs

xinge008 avatar Nov 19 '21 09:11 xinge008

I am working on Windows and I got same error. (Python 3.9; spconv-cu111==2.1.11)

RadekPazderka avatar Nov 23 '21 14:11 RadekPazderka

It might be a difference of spconv version; I used spconv==1.2.1, and it is better to keep its version consistent;

I do not try it with spconv==2.1.6; It seems a huge advance compared to 1.x.x;

So, can you try spconv==1.2.1? and give the detailed logs

I receive this error: train_cylinder_asym.py Namespace(config_path='config/semantickitti.yaml') [480 360 32] Traceback (most recent call last): File "/home/stud2/j/johanb17/Cylinder3D-master/train_cylinder_asym.py", line 170, in main(args) File "/home/stud2/j/johanb17/Cylinder3D-master/train_cylinder_asym.py", line 55, in main my_model = model_builder.build(model_config) File "/home/stud2/j/johanb17/Cylinder3D-master/builder/model_builder.py", line 19, in build cylinder_3d_spconv_seg = Asymm_3d_spconv( File "/home/stud2/j/johanb17/Cylinder3D-master/network/segmentator_3d_asymm_spconv.py", line 274, in init self.downCntx = ResContextBlock(num_input_features, init_size, indice_key="pre") File "/home/stud2/j/johanb17/Cylinder3D-master/network/segmentator_3d_asymm_spconv.py", line 46, in init self.conv1 = conv1x3(in_filters, out_filters, indice_key=indice_key + "bef") File "/home/stud2/j/johanb17/Cylinder3D-master/network/segmentator_3d_asymm_spconv.py", line 20, in conv1x3 return spconv.SubMConv3d(in_planes, out_planes, kernel_size=(1, 3, 3), stride=stride, padding=(0, 1, 1), bias=False, indice_key=indice_key) AttributeError: module 'spconv' has no attribute 'SubMConv3d'

JohanBergius avatar Mar 21 '22 14:03 JohanBergius

I got the same issue,how do you solve this problem?

rogercomeon avatar May 15 '22 12:05 rogercomeon

change "import spconv" to "import spconv.pytorch as spconv" inside: /network/segmentator_3d_asymm_spconv.py

nerovalerius avatar May 24 '22 09:05 nerovalerius

and there's a fix for the whole file, since some other problems also occur.

https://github.com/xinge008/Cylinder3D/blob/df586da89e6275b21370d46619409c42340e1401/network/segmentator_3d_asymm_spconv.py

nerovalerius avatar May 24 '22 10:05 nerovalerius

and there's a fix for the whole file, since some other problems also occur.

https://github.com/xinge008/Cylinder3D/blob/df586da89e6275b21370d46619409c42340e1401/network/segmentator_3d_asymm_spconv.py

Thank you very much!!!

BIAO-ac avatar Jul 11 '22 16:07 BIAO-ac

@BIAO-ac The github link contains a typo 'reA = ' instead of 'resA= '.

Refer to this issue, where the Spconv2.x. implementation is discussed in more detail, if needed.

L-Reichardt avatar Sep 30 '22 14:09 L-Reichardt

Hi everyone!

I successfully modified the code to the spconv 2.3.6!

See this link for details.

antao97 avatar Jun 15 '23 03:06 antao97