How to Disable IExecutionContext execute() logging on terminal


I am using TensorRT engine for inference using Jetson TX2

with engine.create_execution_context() as context:
   context.debug_sync = False
   # Transfer input data to the GPU.
   cuda.memcpy_htod_async(d_input_1, h_input_1, stream)
   # Run inference.
   print('load profiler')
   context.profiler = trt.Profiler()
   context.execute(batch_size=1, bindings=[int(d_input_1), int(d_output)])
   print('Transfer predictions back from the GPU.')
   # Transfer predictions back from the GPU.
   cuda.memcpy_dtoh_async(h_output, d_output, stream)
   # Synchronize the stream
   # Return the host output.
   out = h_output.reshape((1,-1))
   return out

Each time context.execute(batch_size=1, bindings=[int(d_input_1), int(d_output)]) it logs the model layers all of them which makes the console not suitable for debugging. I tried to disable it but I couldn’t.
I think the problem is in this method engine.create_execution_context() as documented in the api this return IExecutionContext with debug_sync set to True . I don’t know if this is a bug or not.

I used context.debug_sync = False but it didn’t stop logging the execution layers.
how I could disable logging the execution layers on the terminal?


TensorRT Version:
GPU Type: Jetson TX2
CUDA Version: 10.2.89
CUDNN Version:
Operating System + Version: jetpack 4.4.1
TensorFlow Version (if applicable): 2.3.1+nv20.10

Relevant Files (3.0 KB)

Please refer to the installation steps from the below link if in case you are missing on anything
However suggested approach is to use TRT NGC containers to avoid any system dependency related issues.

In order to run python sample, make sure TRT python packages are installed while using NGC container.

Hi @ammaz99,

IExecutionContext does not log layers. Looks like you’re using a profiler context.profiler = trt.Profiler()
which is why you’re seeing this behavior.

Thank you.

@spolisetty .Thanks man. It worked!

1 Like