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:
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!
Looking at the logs of the trtexec command used, a 512x512 input image shape is being set. If we understand the graph correctly, a 512x512 image results in 64*64 + 32*32 + 16*16 = 4096 + 1024 + 256 = 5376 anchors. However, the Tile_428 op (just before that problematic Add_430 op) has a hardcoded 8400 anchors on it. So the Add op is running with two input tensors, one with an anchor dim of 8400 and the other with an anchor dim of 5376, thus the error.
So there are two possible solutions:
Use the exact image size that this model was exported for, such that it ends up using exactly 8400 anchors.
If the 512x512 input image is a hard requirement, then the anchor generator will need to be updated to use that input resolution.