How to suppress TensorRT-related warning messages?


When I run the code, TensorRT-related warning messages appear.

[11/14/2023-16:54:39] [TRT] [W] The enqueue() method has been deprecated when used with engines built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. Please use enqueueV2() instead.
[11/14/2023-16:54:39] [TRT] [W] Also, the batchSize argument passed into this function has no effect on changing the input shapes. Please use setBindingDimensions() function to change input shapes instead.

These warning messages affect the output of certain results I want to see.

I would like to know how to prevent these warning messages from appearing when I run the code.


Hi @rd3.pesi ,
You can modify the ProfileVerbosity level to remove warning messages. Please refer to the following doc.

Also how a parameter impacts the output can be understood from the api ref document, for e.g., the role of enqueueV2() can be understood from here.

Hi @AakankshaS

I should make these modifications in which location?
Do I need to modify specific files, or should I add them to my code?


Hello @AakankshaS ,

Can you provide an answer for me?
Thank you

Not sure if you’ve seen the message.
If you have, could you please help respond?