Suppress tensorflow-metal initialization messages

Is there a way to stop the following messages when initializing tensorflow with "tensorflow-metal" installed?

Metal device set to: Apple M2 Max
systemMemory: ###.00 GB
maxCacheSize: ###.00 GB

Searching the net, I only came across the following link without any solution: https://stackoverflow.com/questions/73615934/suppress-tensorflow-metal-initialization-messages

I have tried everything but was unable, and in my case these messages are cluttering the console. I believe these messages originate in the following binary file:

/Users/staff/venv-metal/lib/python3.10/site-packages/tensorflow-plugins/libmetal_plugin.dylib

Thanks to anyone who can share the solution!

Hi @GoodGuyGreg!

Thanks for reporting this. The issue seems to be that the above message gets streamed directly to the standard output so it doesn't follow the same logic as TensorFlow logging messages. I'll create a work item for us to move the printout to be streamed into the TensorFlow logger instead so it can be disabled along the usual TensorfFlow information printouts.

Suppress tensorflow-metal initialization messages
 
 
Q