TensorRT Error: Cannot find binding of given name

Description

I have a 3 layer conventional neural network trained in Keras which takes in a [1,46] input and outputs 4 different classes at the end.

This model was converted to ONNX using TF2ONNX.

I performed a conversion of a ONNX model to a tensorRT engine using TRTexec on the Jetson Xavier using jetpack 4.6 with this exact command

trtexec --onnx=nn_embedded.onnx --saveEngine=nn_embedded_trt

When performing inference, I am using the infer() and load_engine() functions from here

This is when I run into this error code

[03/29/2022-15:23:54] [TRT] [E] 3: Cannot find binding of given name: input
[03/29/2022-15:23:54] [TRT] [E] 3: [executionContext.cpp::setBindingDimensions::925] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::setBindingDimensions::925, condition: mEngine.bindingIndexBelongsToProfile( bindingIndex, mOptimizationProfile, “IExecutionContext::setBindingDimensions”)

I would like to check what is the meaning of this error code and how to resolve this issue?

From similar topics on the forum, it seems that the error on my end could have occurred when I did the conversion from the ONNX model to the TensorRT engine.

Environment

Jetson Jetpack 4.6 on Jetson Xavier NX

Relevant Files

Please attach or include links to any models, data, files, or scripts necessary to reproduce your issue. (Github repo, Google Drive, Dropbox, etc.)

Steps To Reproduce

Please include:

  • Exact steps/commands to build your repro
  • Exact steps/commands to run your repro
  • Full traceback of errors encountered

Hi,

Please refer following similar issue.

Thank you.

Hi,

This looks like a Jetson issue. Please refer to the below samples in case useful.

For any further assistance, we will move this post to to Jetson related forum.

Thanks!