How to set the print prohibition method when a warning appears when TensorFlow is running

Sometimes it is annoying to run TensorFlow, and some warnings such as warnings or version updates are often reported, as follows:

 

So how to remove or not display these things, you can do it by simply adding a few lines of code, let's take a look.

 

This way there will be no warning.

Summarize:

1  import os
 2 os.environ[ " TF_CPP_MIN_LOG_LEVEL " ]= ' 1 ' 
3   #Default display level, display all information 4 os.environ[ " TF_CPP_MIN_LOG_LEVEL " ]= ' 2 ' 5 # Only display warning and Error   6 os.environ [ " TF_CPP_MIN_LOG_LEVEL " ]= ' 3 ' 7 # only display Error

 

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324448357&siteId=291194637