Trtexec execution fails

Description

Hello,
I am trying to compile onnx engine using trtexec. However, I got this error.

[05/20/2025-22:23:29] [E] Error[4]: ITensor::getDimensions: Error Code 4: API Usage Error (Error while computing output extent of node /model/transformer/Concat_14.)
[05/20/2025-22:23:29] [E] [TRT] ModelImporter.cpp:1012: While parsing node number 3 [Relu -> "/model/backbone/stem/stem1/act/Relu_output_0"]:
[05/20/2025-22:23:29] [E] [TRT] ModelImporter.cpp:1015: --- Begin node ---
input: "/model/backbone/stem/stem1/bn/Add_output_0"
output: "/model/backbone/stem/stem1/act/Relu_output_0"
name: "/model/backbone/stem/stem1/act/Relu"
op_type: "Relu"

[05/20/2025-22:23:29] [E] [TRT] ModelImporter.cpp:1016: --- End node ---
[05/20/2025-22:23:29] [E] [TRT] ModelImporter.cpp:1018: ERROR: ModelImporter.cpp:251 In function parseNode:
[6] Invalid Node - /model/transformer/Concat_14
ITensor::getDimensions: Error Code 4: API Usage Error (Error while computing output extent of node /model/transformer/Concat_14.)
[05/20/2025-22:23:29] [E] Failed to parse onnx file

I am not an expert in tensorrt, but what i understood from the error message is that the node /model/transformer/Concat_14 has as input /model/backbone/stem/stem1/act/Relu_output_0. I do not understand this since, in my python code, the transformer module does not use any info from the backbone.

Relevant Files

log.txt (982.8 KB)
onnx_graph_viz.zip (1.5 MB)

Hi,

  • Your error is from TensorRT failing to infer output shape at a concat node due to unexpected input tensors.
  • Inspect the ONNX graph to confirm actual connections.
  • Verify your export process matches your intention (backbone separate or combined).
  • Fix shapes and possibly simplify the ONNX graph.
  • Run ONNX shape inference and simplify model.
  • Ensure static input shapes.
    Please let me know if the above pointers helps.

Thanks