Network has dynamic or shape inputs, but no optimization profile has been defined cannot be resolved

I want to infer the learning model of efficientnet at high speed using TensorRT.
Since the original onnx_resnet50.py worked,
I wanted to try it with a trained model of efficientnet

First, save the trained model of efficientnet in savedmodel format with the following program
The saved file name is effi_saved_model

import os
import sys
import numpy as np
import tensorflow as tf

save_path = ‘effi_saved_model’

model = tf.keras.applications.EfficientNetB2(weights=‘imagenet’)
model.save(save_path)

Next, execute the following command
The saved file name is effi_saved_model.onnx

python3 -m tf2onnx.convert --saved-model effi_saved_model --output effi_saved_model.onnx

In usr / src / tensorrt / data / resnet50
Include effi_saved_model.onnx

In usr / src / tensorrt / samples / python / introduction_parser_samples / onnx_resnet50.py, with

MODEL_PATH = “effi_saved_model.onnx”
INPUT_SHAPE = (3,260,260)

Changed

I ran

python3 onnx_resnet50.py

but the following error cannot be resolved.

Network has dynamic or shape inputs, but no optimization profile has been defined
Network validation failed

Hi,

The error indicates that your model is dynamic but no corresponding profile data is provided.
Usually, we recommend to fix the batch size if you don’t need to change it among inferencing.

To do this, please specify the --inputs value based on your model:

Thanks

python3 -m tf2onnx.convert --saved-model effi_saved_model --output effi_saved_model.onnx --input input_1: 0 [1,260,260,3]

It worked.

thanks you.