Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different versions of TensorRT get different model inference results on GroundingDino model #4209

Open
demuxin opened this issue Oct 18, 2024 · 6 comments
Labels
Accuracy Output mismatch between TensorRT and other frameworks triaged Issue has been triaged by maintainers

Comments

@demuxin
Copy link

demuxin commented Oct 18, 2024

Description

I inference the groundingDino model using C++ TensorRT.

For the same model and the same image, TensorRT 8.6 can gets the correct detection boxes.

But when I update TensorRT to 10.4, can't get detection boxes.

Possible model result error caused by TensorRT 10.4, How can I analyze this issue?

By the way, I've tried multiple versions other than 8.6 (eg 9.3, 10.0, 10.1), None of them get detection boxes.

additional information below:

I load the save onnx model via C++ TensorRT and print the information for each layer.

TensorRT 8.6 loaded a model with 21060 layers and TensorRT 10.4 loaded a model with 37921 layers, why is the difference in the number of layers so large?

rt104_layers.txt
rt86_layers.txt

Environment

TensorRT Version: 8.6.1.6 / 10.4.0.26

NVIDIA GPU: GeForce RTX 3090

NVIDIA Driver Version: 535.183.06

CUDA Version: 12.2

Relevant Files

Model link: https://drive.google.com/file/d/1VRHKT7cswtDVXNUUmebbPmBSAOyd-fJN/view?usp=drive_link

@yuanyao-nv yuanyao-nv added triaged Issue has been triaged by maintainers Accuracy Output mismatch between TensorRT and other frameworks labels Oct 18, 2024
@yuanyao-nv
Copy link
Collaborator

Can you please try TRT 10.5? There was a known accuracy bug that was fixed in 10.5. Thanks!

@demuxin
Copy link
Author

demuxin commented Oct 22, 2024

Hi @yuanyao-nv , I tried TRT 10.5, but the model still has no output box.

How can this problem be solved?

@demuxin
Copy link
Author

demuxin commented Dec 9, 2024

Hi @yuanyao-nv , I tried TRT 10.7, but the model output many wrong boxes.

How can this problem be solved?

Image

@yuanyao-nv
Copy link
Collaborator

@demuxin Can you please provide the exact command or script you used to run this ONNX model?
Also, have you checked using onnxruntime to see if it produces the correct output?

@demuxin
Copy link
Author

demuxin commented Dec 10, 2024

I doesn't check model using onnxruntime, but I tested the onnx model using C++ TensorRT 8.6, the output result is correct.

And I tested the same model using other version of C++ TensorRT, the output result is wrong.

So the onnx model shouldn't be a problem.

@demuxin
Copy link
Author

demuxin commented Dec 10, 2024

I found that there are some different warning log when build the trt engine:

TensorRT 8.6:

[libprotobuf WARNING google/protobuf/io/coded_stream.cc:604] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:81] The total number of bytes read was 968870665
WARN: [AlgoLib] /nvidia/engine_impl.h : 18 , onnx2trt_utils.cpp:374: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
WARN: [AlgoLib] /nvidia/engine_impl.h : 18 , onnx2trt_utils.cpp:400: One or more weights outside the range of INT32 was clamped

TensorRT 10.4:

WARN: [AlgoLib] /nvidia/engine_impl.h : 18 , ModelImporter.cpp:420: Make sure input input_ids has Int64 binding.
WARN: [AlgoLib] /nvidia/engine_impl.h : 18 , ModelImporter.cpp:420: Make sure input position_ids has Int64 binding.
WARN: [AlgoLib] /nvidia/engine_impl.h : 18 , ModelImporter.cpp:420: Make sure input token_type_ids has Int64 binding.

Would these warning logs be useful?
.
.
.

Can you please provide the exact command or script you used to run this ONNX model?

Our code has a relatively high degree of encapsulation, Extracting the code snippet out is not very convenient.

Can you run the onnx model using TensorRT 10.4, I can offer you input data files .

input86_0.txt
input86_1.txt
input86_2.txt
input86_3.txt
input86_4.txt
input86_5.txt

@demuxin demuxin changed the title Different versions of TensorRT get different model inference results Different versions of TensorRT get different model inference results on GroundingDino model Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accuracy Output mismatch between TensorRT and other frameworks triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants