Giving input in NHWC format to tensor rt network in trt7


i have an application in which i store image in cv::MAT objects, and since cv:MAT objects store images in NHWC format id like to give the raw data of cv::MAT as input rather than reformatting the data to NCHW. is it possible to change the input tensor format to NHWC cz in the dev guide, thers no mention of NHWC format. I’ve tried giving kCHW format in setAllowedformats but it didnt work.


TensorRT Version: 7
GPU Type: titan x pascal
Nvidia Driver Version: 450
CUDA Version: 11

Hi @gjraza,
Yes you can.
In C++, you can use ITensor::setAllowedFormats

In Python,
you can use iTensor.allowed_formats