[TensorRT] ERROR: 4: [network.cpp::validate::2749] Error Code 4: Internal Error (step: optimization profile is missing values for shape input)

Description

I’m trying to build engine from a onnx model. The model has some dynamic inputs and I set up the optimization profile accordingly. Besides that, it has a input step.

name: "step"
type {
  tensor_type {
    elem_type: 7
    shape {
      dim {
        dim_value: 1
      }
    }
  }
}

Then I got this error “[TensorRT] ERROR: 4: [network.cpp::validate::2749] Error Code 4: Internal Error (step: optimization profile is missing values for shape input)”

What does it mean by ‘missing values for shape input’?

Environment

TensorRT Version: 8.0.1.6
GPU Type: 2080Ti
Nvidia Driver Version: 460.80
CUDA Version: 10.2
CUDNN Version: 8.1.1
Operating System + Version: Ubuntu 18.04.4
Python Version (if applicable): 3.8.11
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

Relevant Files

Please attach or include links to any models, data, files, or scripts necessary to reproduce your issue. (Github repo, Google Drive, Dropbox, etc.)

Steps To Reproduce

Please include:

  • Exact steps/commands to build your repro
  • Exact steps/commands to run your repro
  • Full traceback of errors encountered

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:
https://docs.nvidia.com/deeplearning/tensorrt/quick-start-guide/index.html#onnx-export

  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.
https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/trtexec
In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging
Thanks!

Magically it works with trtexec… but not my Python script. Anyway thank you

Hi,

Please refer following doc for more details on working with dynamic shape inputs/optimization profile. If you still face this issue, please share us issue repro script/model for better debugging.
https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#opt_profiles

Thank you.