I have exported a PyTorch model to ONNX and the output matches, which means the ONNX model seems to be working as expected. However, after generating Tensorrt Engine from this ONNX file the outputs are different.
Environment
TensorRT Version: 8.0.1.6 GPU Type: Tesla V100-PCIE-16GB-LS Nvidia Driver Version: 470.129.06 CUDA Version: 10.2 CUDNN Version: CUDNN_MAJOR 8 Operating System + Version: Ubuntu 18.04.6 LTS Python Version (if applicable): python3.6 TensorFlow Version (if applicable): PyTorch Version (if applicable): Baremetal or Container (if container which image + tag):
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:
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.
In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging
Thanks!