Last active
November 20, 2019 17:08
-
-
Save cshjin/0e44317085d2c186cda1aa15bb126dfb to your computer and use it in GitHub Desktop.
Clean up the log info in running tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
# import tf 2.X | |
import tensorflow.compat.v2 as tf | |
except Exception: | |
# import tf 1.X | |
import tensorflow as tf | |
tf.logging.set_verbosity(tf.logging.ERROR) | |
print('Using TF {}'.format(tf.__version__)) | |
# set logging level for tf | |
import os | |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' | |
# set warning level for numpy | |
import warnings | |
warnings.simplefilter(action='ignore', category=FutureWarning) | |
warnings.simplefilter(action='ignore', category=DeprecationWarning) | |
import numpy as np | |
print(tf.test.is_gpu_available()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment