Compile onnx model via trtexec Jetpack 5.0.2

Hi,
i’m facing an issue converting one onnx model with dynamic shapes into a trt/engine file on jetson xavier nx.
I’m using this command:

/usr/src/tensorrt/bin/trtexec --onnx=modellodasaved.onnx --saveEngine=m1t1_engine.trt --shapes=image_input:-1x-1x-1x3,template_input:-1x-1x-1x3 --minShapes=image_input:1x1x1x3,template_input:1x1x1x3 --maxShapes=image_input:1x800x600x3,template_input:1x600x400x3 --optShapes=image_input:1x800x600x3,template_input:1x600x400x3 --verbose

the final error is:

[09/23/2022-12:21:31] [V] [TRT] *************** Autotuning Reformat: Float((* (# 2 E2) (+ (# 1 (RESHAPE 1 E3 E4 320 | 1 (* E3 E4) -1 zeroIsPlaceholder)) (# 1 E2))),(# 2 E2),1) where E0=(+ (CEIL_DIV (+ (# 1 (SHAPE image_input)) -7) 4) 1) E1=(+ (CEIL_DIV (+ (# 2 (SHAPE image_input)) -7) 4) 1) E2=(RESHAPE 1 E0 E1 320 | 1 (* E0 E1) -1 zeroIsPlaceholder) E3=(+ (CEIL_DIV (+ (# 1 (SHAPE template_input)) -7) 4) 1) E4=(+ (CEIL_DIV (+ (# 2 (SHAPE template_input)) -7) 4) 1) → Float(1,(# 2 (RESHAPE 1 E0 E1 320 | 1 (* E0 E1) -1 zeroIsPlaceholder)),1) where E0=(+ (CEIL_DIV (+ (# 1 (SHAPE image_input)) -7) 4) 1) E1=(+ (CEIL_DIV (+ (# 2 (SHAPE image_input)) -7) 4) 1) ***************
[09/23/2022-12:21:31] [V] [TRT] Deleting timing cache: 60 entries, served 14 hits since creation.
[09/23/2022-12:21:31] [E] Error[2]: [blockChooser.cpp::getRegionBlockSize::666] Error Code 2: Internal Error (Assertion memSize >= 0 failed. )
[09/23/2022-12:21:31] [E] Error[2]: [builder.cpp::buildSerializedNetwork::636] Error Code 2: Internal Error (Assertion engine != nullptr failed. )

Thanks in advice for your kind help.

modellodasaved.onnx (8.9 MB)