mit-han-lab / torchsparse

[MICRO'23, MLSys'22] TorchSparse: Efficient Training and Inference Framework for Sparse Convolution on GPUs.
https://torchsparse.mit.edu
MIT License
1.22k stars 143 forks source link

Some conditions of Transposed Upsampling in U-Shaped network #294

Closed CaomouN closed 6 months ago

CaomouN commented 8 months ago

Is there an existing issue for this?

Current Behavior

Firstly, I would like to thank you for this work. Torchsparse has provided me with a lot of help in building my network. But when I was building a U-shaped encoding and decoding network, I encountered an upsampling error message as shown below. The error message shows that the Kernel Map cannot be built well, and entering kmap as Nonetype prevents the code from running correctly. The convolutional kernel of the Transform can only be successfully constructed when the kernel size is 1. I would like to ask if there are any prerequisites required for initializing convolution during the upsampling process using deconv.

Expected Behavior

File "/home/lmy/anaconda3/envs/former3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(*input, *kwargs) File "/home/lmy/anaconda3/envs/former3d/lib/python3.8/site-packages/torch/nn/modules/container.py", line 204, in forward input = module(input) File "/home/lmy/anaconda3/envs/former3d/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(input, **kwargs) File "/home/share/lmy1/3DRecon/former3d-main/torchsparse-master/torchsparse/nn/modules/conv.py", line 98, in forward return F.conv3d( File "/home/share/lmy1/3DRecon/former3d-main/torchsparse-master/torchsparse/nn/functional/conv/conv.py", line 138, in conv3d kmap = F.transpose_kernel_map( File "/home/share/lmy1/3DRecon/former3d-main/torchsparse-master/torchsparse/nn/functional/conv/kmap/build_kmap.py", line 233, in transpose_kernel_map kmap["out_in_map"], make_divisible(kmap["sizes"][0], cta_M) The error of my project shows here. I try somethings to fix this but it dosent work well. Here, I am sure that my sparsetensor is not None and the channels of input is right. So, what can i do to solve this problem.Looking forward to your reply, it is very important to me. Thank you.

Environment

- GCC:9.4.0
- NVCC:11.7.99
- PyTorch:1.13.0
- PyTorch CUDA:1.13.0
- TorchSparse:2.1.0

Anything else?

No response

ys-2020 commented 8 months ago

Hi, thanks for your interest in TorchSparse. Can you provide more details about the error? What is the error message you received here?