To turn off debugging information in Tensorflow, you can set the logging level to a higher level than the default DEBUG level. This can be done by adding the following line of code at the beginning of your script:
import logging
logging.getLogger('tensorflow').setLevel(logging.WARNING)
This sets the logging level of the 'tensorflow' logger to WARNING, which means that only messages of level WARNING and higher will be outputted to the console.
You can also set the logging level to ERROR, which will only output error messages to the console, or CRITICAL to only output critical messages.
Alternatively, you can set the environment variable TF_CPP_MIN_LOG_LEVEL
to a specific value. The possible values are:
- 0: default (output all messages)
- 1: filter out INFO messages
- 2: filter out INFO and WARNING messages
- 3: filter out all messages except ERROR messages
For example, to set the logging level to ERROR, you can add the following line in your script or in the command prompt:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
Note that setting the environment variable will affect all instances of Tensorflow running on your system, not just the one script or command prompt.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-04-26 11:00:00 +0000
Seen: 17 times
Last updated: Jun 28 '22
How can information be extracted by dividing a line?
What is the method to retrieve LegacyIAccessible information using UiAutomation?
What is the method to transfer information from a popup to the main content in a Chrome extension?
What are some examples of entities in Microservice Architecture that have common properties?
What is the best approach to calculate pairwise mutual information using numpy?
What is the issue with the presentation of the final question?
In Flutter, what is the method to use for updating information in Firestore?