Haiyang-W / DSVT

[CVPR2023] Official Implementation of "DSVT: Dynamic Sparse Voxel Transformer with Rotated Sets"
https://arxiv.org/abs/2301.06051
Apache License 2.0
353 stars 28 forks source link

Deploy Problem 2 #42

Closed sylcito closed 1 year ago

sylcito commented 1 year ago

Hi, thanks your great work! Another question about Pytorch-ONNX-TensorRT conversion.

In the forward function of SetAttention, indexing is used at the beginning to retrieve values. However, when deploying similar operations, TensorRT does not support this because the indices are also a changing tensor, rather than fixed indices like x=torch.tensor([1, 2]), x[0]. How did you solve this in your TensorRT engine? Could you please provide some guidance?

https://github.com/Haiyang-W/DSVT/blob/3b825d11e7695d514d795457771508859a44a08b/pcdet/models/backbones_3d/dsvt.py#L245

Wish your reply.

chenshi3 commented 1 year ago

You need to specify the dynamic shape in Pytorch-ONNX-TensorRT conversion.

sylcito commented 1 year ago

You need to specify the dynamic shape in Pytorch-ONNX-TensorRT conversion.

Same as this? https://github.com/Haiyang-W/DSVT/blob/3b825d11e7695d514d795457771508859a44a08b/tools/deploy.py#L194

chenshi3 commented 1 year ago

Yep. You should to specify it in the trtexec command as well.