Custom initialization function for more than one input layers

**• Hardware Platform : T4
**• DeepStream Version :5.1
**• TensorRT Version 7.2.1-1+cuda11.1
**• NVIDIA GPU Driver Version : 418.67
**• Issue Type :questions/new requiremenet
**• Requirement details:
I try to import some onnx model which has multiple input layers. When I load the onnx model I got below errors, which indicate the nvinfer plugin can’t handel multiple inputs. Is there any guide or sample on how to define a custom initialization function for the input layers?

0:00:13.969209930 4591 0x56377e4a2320 WARN nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger: NvDsInferContext[UID 3]: Warning from NvDsInferContextImpl::initNonImageInputLayers() <nvdsinfer_context_impl.cpp:1379> [UID = 3]: More than one input layers but custom initialization function not implemented
0:00:13.969235669 4591 0x56377e4a2320 ERROR nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger: NvDsInferContext[UID 3]: Error in NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1181> [UID = 3]: Failed to initialize non-image input layers
0:00:13.988960527 4591 0x56377e4a2320 WARN nvinfer gstnvinfer.cpp:812:gst_nvinfer_start: error: Failed to create NvDsInferContext instance
0:00:13.988989830 4591 0x56377e4a2320 WARN nvinfer gstnvinfer.cpp:812:gst_nvinfer_start: error: Config file path: config_infer_secondary_body.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_FAILED

Hey customer,
Yeah, current nvinfer cannot support multiple input model, I think you need to more deep customization in nvinfer to support it.

In addition, we will consider adding it to our roadmap features.

My onnx model has three identical input frame from the source:
0 INPUT kFLOAT input.1 3x448x448
1 INPUT kFLOAT input.4 3x448x448
2 INPUT kFLOAT input.7 3x448x448

I found nvdsinfer_custom_impl.h File Reference (
"By default “nvinfer” works with networks having only one input layer for video frames. If the network has more than one input layer, the custom library can implement NvDsInferInitializeInputLayers interface for initializing the other input layers. “nvinfer” assumes that the other input layers have static input information and hence this method is called only once before the first inference.
Refer the FasterRCNN sample provided with the SDK for a sample implementation of the interface."

I read quickly the FasterRCNN sample, which indicate static input for other layers. So is there a way to input multiple consecutive frames from source into a model in current deepstream version?

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.

Hey, could you provide more info about your model?