TensorRT
TensorRT copied to clipboard
How to set the input when compiling model for non-image input?
Hi, I have trained a model whose input is a set of 3D points with a shape Nx3, N is not a fixed number. In this case, how to set the input during compiling my model?
For image, the input shape is like this:
inputs = [torch.randn((1, 3, 224, 224)).to("cuda").half()]
What if for my case? Thank you!
### Tasks
Hello - for models with tensors that have Dynamic dimensions, you can specify the minimum, optimal, and maximum shapes via the torch_tensorrt.Input API. For instance, when compiling via torch_tensorrt.compile, you could specify:
torch_tensorrt.compile(model,
inputs=[
torch_tensorrt.Input(
min_shape=(1, 3, 224, 224),
opt_shape=(3, 3, 224, 224),
max_shape=(10, 3, 224, 224))]
...