• Hardware Platform (Jetson / GPU): GPU
• DeepStream Version: 6.0
• TensorRT Version: 8.0.1
• NVIDIA GPU Driver Version (valid for GPU only): 495.29.05
• Issue Type( questions, new requirements, bugs): questions, bugs
Hi,
I can successfully create TRT engine from yolov4 onnx model containing BatchedNMSDynamic plugin. I add this plugin by this script. Now I want to use BatchedNMS plugin for static batch size instead of BatchedNMSDynamic to compare them in terms of speed. According the docs, both plugins have the same outputs and these are num_detections, nmsed_boxes, nmsed_scores and nmsed_classes.
The creation of the TRT engine from onnx model containing BatchedNMS plugin by trtexec is ok, but when I try to use it in the Deepstream pipeline, it gives me following error:
0 INPUT kFLOAT input 3x544x544
1 OUTPUT kINT32 num_detections 0
2 OUTPUT kFLOAT nmsed_boxes 1000x4
3 OUTPUT kFLOAT nmsed_scores 1000
4 OUTPUT kFLOAT nmsed_classes 1000
main: nvdsinfer_context_impl.cpp:1412: NvDsInferStatus nvdsinfer::NvDsInferContextImpl::allocateBuffers(): Assertion `bindingDims.numElements > 0' failed.
Aborted (core dumped)
I do not know why num_detections is 0. Only what I found from trtexec logs, that both TRT engines have different dimension for num_detections outputs:
Logs from trtexec during creation of TRT model with BatchedNMS plugin:
input 8x3x544x544
num_detections with dimensions 8
nmsed_boxes with dimensions 8x1000x4
nmsed_scores with dimensions 8x1000
nmsed_classes with dimensions 8x1000
Logs from trtexec during creation of TRT model with BatchedNMSDynamic plugin:
input 8x3x544x544
num_detections with dimensions 8x1
nmsed_boxes with dimensions 8x1000x4
nmsed_scores with dimensions 8x1000
nmsed_classes with dimensions 8x1000
And it is weird!
I also checked both onnx models containing BatchedNMS plugin and BatchedNMSDynamic plugin with Netron and the outputs of both models are completely same.
Onnx model with BatchedNMS plugin:

Onnx model with BatchedNMSDynamic plugin:

It seems to me like a bug in the BatchedNMS. Do you have any idea?