maggiez0138 / Swin-Transformer-TensorRT

This project aims to explore the deployment of Swin-Transformer based on TensorRT, including the test results of FP16 and INT8.
MIT License
161 stars 29 forks source link

Swin does not support dynamic input shape after tracing the module #11

Open fatemebafghi opened 1 year ago

fatemebafghi commented 1 year ago

hello there, I am trying to convert swin model to onnx and then tensorrt, but a problem which I face is that it does not support dynamic input resolution after tracing the model using torch.jit.trace. It seems that it is because of the mask input in window attention. Do you have any idea how I can fix this problem?

maggiez0138 commented 1 year ago

hello there, I am trying to convert swin model to onnx and then tensorrt, but a problem which I face is that it does not support dynamic input resolution after tracing the model using torch.jit.trace. It seems that it is because of the mask input in window attention. Do you have any idea how I can fix this problem?

Please refer to the export-to-onnx-and-build-tensorrt-engine session in Readme. I've done some small changes, maybe it could help you.