# -*- coding: utf-8 -*-
"""
Created on Thu Nov  4 10:17:06 2021

Check Tensorflow installation and logging info
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
"""
# import os
#os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # will disable the logging info from printing 

import tensorflow as tf
tf.get_logger().setLevel('INFO')

print("TensorFlow version:", tf.__version__)

mnist = tf.keras.datasets.mnist

(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

model = tf.keras.models.Sequential([
  tf.keras.layers.Flatten(input_shape=(28, 28)),
  tf.keras.layers.Dense(128, activation='relu'),
  tf.keras.layers.Dropout(0.2),
  tf.keras.layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)
# -*- coding: utf-8 -*-
"""
Created on Thu Nov  4 10:17:06 2021

Check Tensorflow installation and logging info
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
"""
# import os
#os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # will disable the logging info from printing 

import tensorflow as tf
tf.get_logger().setLevel('INFO')

print("TensorFlow version:", tf.__version__)

mnist = tf.keras.datasets.mnist

(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0

model = tf.keras.models.Sequential([
  tf.keras.layers.Flatten(input_shape=(28, 28)),
  tf.keras.layers.Dense(128, activation='relu'),
  tf.keras.layers.Dropout(0.2),
  tf.keras.layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)
# -*- coding: utf-8 -*- Created on Thu Nov  4 10:17:06 2021  Check Tensorflow installation and logging info 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 # import os #os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # will disable the logging info from printing