Tensorrt Dynamic Height&Width
col-in-coding opened this issue · 3 comments
Is it possible to build tensorrt engine with dynamic height and width?
Yes, you need to do some steps to set the height and width dynamically for tensorrt model:
- Set dynamic axises for height and width when converting model from pytorch model to onnx
- Set dynamic shape when converting model from onnx to tensorrt
But as our experiments the height and width do not affect on the speed. You can use smaller num_inference_steps to get faster.
Yes, you need to do some steps to set the height and width dynamically for tensorrt model:
- Set dynamic axises for height and width when converting model from pytorch model to onnx
- Set dynamic shape when converting model from onnx to tensorrt
But as our experiments the height and width do not affect on the speed. You can use smaller num_inference_steps to get faster.
Thx for your response.
But for my experiment, made height and width changeable from 256 to 512, but only outputs with width 512 were correct.
That is so weird!
@Toan-Do I have created a demo based on this issue, would you mind having a look and tell me what's wrong with it
https://github.com/col-in-coding/Tensorrt-CV/blob/master/dynamic_shape_problem.py