[TensorRT] ERROR: input: dynamic input is missing dimensions in profile 0

Hi @lyzs1225,

From glancing at your code and model, it looks pretty good to me. The only thing that stood out, was that when viewing the ONNX model in Netron, the input node’s name is “input”:
image

But your script uses the input name “data”, which matches up with the error saying you didn’t specify dimensions for the input named “input”.

I would try to change this line from “data”:

    profile.set_shape("data", (1, 3, 100, 100), (1, 3, 896, 1312), (1, 3, 2000, 3000))

to “input” (or whatever the actual input node’s name is for an arbitrary model:

    profile.set_shape("input", (1, 3, 100, 100), (1, 3, 896, 1312), (1, 3, 2000, 3000))

You can get the input names programmatically like so:

    # Query input names and shapes from parsed TensorRT network
    network_inputs = [network.get_input(i) for i in range(network.num_inputs)]
    input_names = [_input.name for _input in network_inputs]   # ex: ["actual_input1"]
2 Likes