NVIDIA / MinkowskiEngine

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

how to set same coordinate_map_key #365

Open jihoon9208 opened 3 years ago

jihoon9208 commented 3 years ago

I use this code in resunet.py

out_s8 = self.conv4(out4) out_s8 = self.norm4(out_s8) out_s8 = self.block4(out_s8) out = MEF.relu(out_s8)

out_C1 = out.C * 0.025 out_F1 = out.F gac_C1, gac_F1 = self.gac4(out_C1, out_F1) coord = torch.cat((out.C, gac_C1.T / 0.025), dim=0) feature = torch.cat((out.F, gac_F1.T), dim=0)

out8 = self.make_sparse_tensor(feature, coord, 8 , out.coordinate_map_key, out.coordinate_manager)

but i got this error message SparseTensors must have the same coordinate_map_key.coordinate map key:[8, 8, 8] != coordinate map key:[8, 8, 8]:ncCHr

out_s8 coordinate_map_key:coordinate map key:[8, 8, 8]:ncCHr out8 coordinate_map_key:coordinate map key:[8, 8, 8]

how can i fix it?


Desktop (please complete the following information):

chrischoy commented 3 years ago

Not sure what you are doing inside the make sparse tensor function, but if you want to force the output to use a specific key, feed the key as an additional argument to convolution/pool etc. https://nvidia.github.io/MinkowskiEngine/convolution.html#MinkowskiEngine.MinkowskiConvolution.forward

jihoon9208 commented 3 years ago

Using the coordinate and feature of the results of the sparse convolution, I process "self.gac4(out_C1, out_F1)". The result of this function is a tensor shaped coordinate and feature, which i would like to set in the "out" variable. Is there any way I can do it?