I'm trying to suppress all the warning/logging messages that come up when I use the fit method in Keras. For reference I'm using WSL2/Ubuntu with a Docker image to use the GPU on Windows 11. Here are the particular messages that I'm trying to suppress:
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR I0000 00:00:1713790925.944867 30151 service.cc:145] XLA service 0xbdb2bb0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: I0000 00:00:1713790925.944907 30151 service.cc:153] StreamExecutor device (0): NVIDIA GeForce RTX 4070 Ti SUPER, Compute Capability 8.9 I0000 00:00:1713790927.034790 30151 device_compiler.h:188] Compiled cluster using XLA! This line is logged at most once for the lifetime of the process.
Using this code allowed me to suppress some other messages, but I haven't been able to get rid of the messages above.
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ['PYCARET_CUSTOM_LOGGING_LEVEL'] = 'CRITICAL'
The warnings module also does nothing to help. If I was just running the fit method once I could ignore these warnings, but I'm running it hundreds of times in a custom hyperparameter tuning loop and it prints this every iteration, flooding my notebook. Is there something I'm missing that would suppress everything?