A model converted from ONNX to TensorRT does not produce the correct inference results. A dynamically-shaped TF model for pose estimation (MoveNet multipose) was converted to ONNX format using tf2onnx converter. I verified that the ONNX model gives the same output as the TF model. I converted the ONNX model to TRT format using trtexec. The generated TRT model does not give the same output as the ONNX model: the model output is the correct shape, but the values are incorrect.
Can you please provide guidance to try and get the TRT model working correctly?
Environment
TensorRT Version: 8.5.7.1 GPU Type: RTX 3060 (Laptop) Nvidia Driver Version: Studio Driver 522.30 CUDA Version: 11.7 & 11.8 CUDNN Version: 8.6.0 Operating System + Version: Windows 10 (19044.2251) Python Version (if applicable): 3.9.6 Baremetal or Container (if container which image + tag): Bare metal
Use trtexec as follows: ‘C:\Program Files\NVIDIA\TensorRT\v8.5.1.7\bin\trtexec.exe’ --onnx=model.onnx --saveEngine=model.trt --shapes=input:1x192x256x3
Run the test script with both models on a test image whose shape is close to 192x256.
We are unable to successfully run the script you’ve shared in the command line. Facing QT related errors.
However, we could reproduce the accuracy difference between TensorRT and ONNX-Runtime. Please allow us some time to work on this.
I received an email (doesn’t seem to be shown on this thread for some reason) suggesting I check out the following documentation:
and recommending that I “write new plugins or refactor existing ones to target the IPluginV2DynamicExt or IPluginV2IOExt interfaces instead.”.
I’m not sure how this helps me - could you please elaborate a little? I’m relatively new to deep learning in general, let alone TensorRT, so any extra guidance would be greatly appreciated!