Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to hide tensorflow warnings

def tensorflow_shutup():
    """
    Make Tensorflow less verbose
    """
    try:
        os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'

        # noinspection PyPackageRequirements
        import tensorflow as tf
        from tensorflow.python.util import deprecation

        tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)

        # Monkey patching deprecation utils to shut it up! Maybe good idea to disable this once after upgrade
        # noinspection PyUnusedLocal
        def deprecated(date, instructions, warn_once=True):  # pylint: disable=unused-argument
            def deprecated_wrapper(func):
                return func
            return deprecated_wrapper

        deprecation.deprecated = deprecated

    except ImportError:
        pass
Comment

PREVIOUS NEXT
Code Example
Python :: check how many times a substring appears in a string 
Python :: change default port django 
Python :: matplotlib dateformatter x axis 
Python :: Find the title of a page in python 
Python :: wintp python manage.py createsuperuser 
Python :: current date and time into timestamp 
Python :: copy file python 
Python :: random split train test in python 
Python :: drop a list of index pandas 
Python :: how to find an element in a list python 
Python :: import database in python using sqlalchemy 
Python :: how to convert boolean type list to integer 
Python :: python typing effect 
Python :: python how to remove item from list 
Python :: get column pandas 
Python :: How to take total count of words in the list python 
Python :: virtualenv specify python version 
Python :: iterate backwards through a list python 
Python :: how to use cos in python 
Python :: merge subplot matplotlib 
Python :: read json file using python 
Python :: python pyqt5 
Python :: showing specific columns pandas 
Python :: execute terminal command from python 
Python :: how to get int input in python 
Python :: how to create an empty list of certain length in python 
Python :: flask cookies 
Python :: pycocotools python3.7 
Python :: numpy array split 
Python :: one hot encoding 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =