facebookresearch / SparseConvNet

Submanifold sparse convolutional networks
https://github.com/facebookresearch/SparseConvNet
Other
2.04k stars 332 forks source link

File "/home/libo/SparseConvNet/sparseconvnet/denseToSparse.py", line 58, in forward aa = aa.view(-1, input.size(1)) RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. #220

Closed bobonpu1 closed 2 years ago

bobonpu1 commented 2 years ago

File "/home/libo/SparseConvNet/sparseconvnet/denseToSparse.py", line 58, in forward aa = aa.view(-1, input.size(1)) RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

btgraham commented 2 years ago

What is the input that is causing it to fail? I have swapped .view to .reshape ...

bobonpu1 commented 2 years ago

The input is the batch of images. with the shape of (B,C,H,W). I utilize the contiguous() before put it to the DenseToSparse(), but it doesn't work.

bobonpu1 commented 2 years ago

What is the input that is causing it to fail? I have swapped .view to .reshape ...

Is it right to use DenseToSparse Layer like this?