Can't configure DeepStream classifier to give the same softmax outputs as the TRT engine it builds

I don’t think this pipeline is the same to the TensorRT pipeline.

  1. You introduce extra image scaling with setting different nvstreammux output resolution to the original video resolution.

  2. There is hardware video decoder in RTX 2080. Please use hardware video decoder instead of software decoder “avdec_h264”

  3. Please set the nvstreammux output resolution as the same to the original video resolution.

  4. Please check the Pytorch document to identify the image scaling algorithm. torchvision.transforms — Torchvision master documentation ( You need to set the “scaling-filter” parameter for nvinfer to do the same scaling.

  5. You gives the Pytorch normalization as:

The formula can be found in pytorch document torchvision.transforms — Torchvision master documentation (

And we also gives the nvinfer normalization formula here Gst-nvinfer — DeepStream 6.3 Release documentation(please check the red texts).

These are simple multiplications and additions. It is easy to translate the pytorch parameters to nvinfer parameters.

  1. Please refer to DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums