Skip to content

Instantly share code, notes, and snippets.

@hiepph
Last active November 5, 2019 04:12
Show Gist options
  • Save hiepph/ba76b353a133ce99cf665e1af533abe2 to your computer and use it in GitHub Desktop.
Save hiepph/ba76b353a133ce99cf665e1af533abe2 to your computer and use it in GitHub Desktop.
Python warning
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR) # level 2
#In detail:-
#0 = all messages are logged (default behavior)
#1 = INFO messages are not printed
#2 = INFO and WARNING messages are not printed
#3 = INFO, WARNING, and ERROR messages are not printed
export TF_CPP_MIN_LOG_LEVEL=2
PYTHONWARNINGS=default # Warn once per call location
PYTHONWARNINGS=error # Convert to exceptions
PYTHONWARNINGS=always # Warn every time
PYTHONWARNINGS=module # Warn once per calling module
PYTHONWARNINGS=once # Warn once per Python process
PYTHONWARNINGS=ignore # Never warn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment