Input image shape at Uffparser

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

https://www.dropbox.com/s/plrcvjldmyh86c8/3.png?dl=0

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?

Hi,

The default input order is trt.UffInputOrder.NCHW (1, 3, height, width) as seen in the docs here: https://docs.nvidia.com/deeplearning/sdk/tensorrt-api/python_api/parsers/Uff/pyUff.html#tensorrt.UffParser.register_input

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)

Thanks,
NVIDIA Enterprise Support

Thanks NVES_R.

Hi 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!

Hi,

TensorRT does not currently support variable input size. See here: https://devtalk.nvidia.com/default/topic/1049537/tensorrt/does-tensorrt-allow-variable-input-dimensions-/

Thanks,
NVIDIA Enterprise Support