All named dimensions that share the same name must be equal

Description

A clear and concise description of the bug or issue.

Environment

TensorRT Version: 8.2
GPU Type: T4
Nvidia Driver Version: 470
CUDA Version: 11.4
I have an error report when onnx model is converted to TRT.
model:This is a transformer model for language recognition

command:
./tensorrt/bin/trtexec --explicitBatch --minShapes=speech:1x16x80 --optShapes=speech:4x256x80 --maxShapes=speech:16x256x80 --onnx=encoder_change.onnx --saveEngine=encoder.plan --workspace=28012

Error[4]: [graphShapeAnalyzer.cpp::processCheck::581] Error Code 4: Internal Error (IAssertionLayer (Unnamed Layer* 5) [Assertion]: condition[0] is false: 0. For input: 'speech' all named dimensions that share the same name must be equal. Note: Named dimensions were present on the following axes: 0 (name: 'B'), 0 (name: 'B'))

What does this error mean?
ERROR:

Hi,
Request you to share the ONNX model and the script if not shared already so that we can assist you better.
Alongside you can try few things:

  1. validating your model with the below snippet

check_model.py

import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
onnx.checker.check_model(model).
2) Try running your model with trtexec command.

In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging
Thanks!

How to upload files over 100MB?
I found that only when the batch size of minshapes is greater than 1, there will be an error, otherwise it will be normal.
example:
not work

./tensorrt/bin/trtexec --explicitBatch --minShapes=speech:4x16x80 --optShapes=speech:4x256x80 --maxShapes=speech:16x256x80 --onnx=encoder_change.onnx --saveEngine=encoder.plan --workspace=28012 --verbose

work

./tensorrt/bin/trtexec --explicitBatch --minShapes=speech:1x16x80 --optShapes=speech:4x256x80 --maxShapes=speech:16x256x80 --onnx=encoder_change.onnx --saveEngine=encoder.plan --workspace=28012 --verbose

Verbose does not display any more valid information

The problem has been solved. I set one less input shape