"Using XXX backend" would print when I import keras.
import keras
Outputs:
Using TensorFlow backend.
But I clearly know what I am using.
How to disable it?
Just using the code below.
import os
import sys
stderr = sys.stderr
sys.stderr = open(os.devnull, 'w')
import keras
sys.stderr = stderr
workaround for this problem:
stderr = sys.stderr
sys.stderr = open(os.devnull, 'w')
import keras
sys.stderr = stderr
You can find more info in keras issues here
If you are using Tensorflow 2.0
, then you might get an error saying AttributeError: module 'tf' has no attribute 'logging'
Unfortunately tf.logging
has been removed from tensorflow 2.0
. Please execute the below commands:
import logging
logger = tf.get_logger()
logger.setLevel(logging.ERROR)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With