4

When I run my python script, I had the messages below:

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR

I0000 00:00:1701341037.989729 1542352 device_compiler.h:186] Compiled cluster using XLA! This line is logged at most once for the lifetime of the process.

The next is my python script:

################# Start ############## import os, sys os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf @tf.function(jit_compile=True) def operation(a, b): return a+b print(operation(2, 3)) ################ End ################### 

But I don't want the messages above. I use tensorflow 2.15, Rocky linux 9.3, cuda 2.2/2.3, and python3.9.

1
  • To suppress these warning messages, you can set the TensorFlow log level to suppress all messages except errors. You've already attempted to do this by setting os.environ**['TF_CPP_MIN_LOG_LEVEL'] = '3', which should suppress all INFO, WARNING, and ERROR messages. However, the message "I0000 00:00:1701341037.989729 1542352 device_compiler.h:186] Compiled cluster using XLA!" is not controlled by the **TF_CPP_MIN_LOG_LEVEL environment variable because it's printed directly by TensorFlow's runtime, not through the logging module. Commented Apr 13, 2024 at 14:57

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.