Input image shape at Uffparser

My model input image shape is 1,480,640,3.

But in Uffparser, I need to have in

parser.register_input(ModelData.INPUT_NAME, (1, 3, height, width))

If not, there is error in parsing.
Why can’t be same shape as model input?


The default input order is trt.UffInputOrder.NCHW (1, 3, height, width) as seen in the docs here:

Can you try adding the InputOrder argument as NHWC (1, height, width, 3) instead and see if that works for you?

N = 1
H = 480
W = 640
C = 3
parser.register_input(ModelData.INPUT_NAME, (N, H, W, C), trt.UffInputOrder.NHWC)

NVIDIA Enterprise Support

Thanks NVES_R.


If the input size of the image is fixed, for example
int C=3;
int H=224;
int W=224;
parser->registerInput(“input”, DimsCHW(C, H, W), UffInputOrder::kNCHW);
it can run normally.

If the input size of the image is not fixed, for example C=3, H=?, W=?
How to express parser->registerInput()?
Does tensoeRT support formats with variable input sizes?

Thank you very much!


TensorRT does not currently support variable input size. See here:

NVIDIA Enterprise Support