Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING from Tensorflow when creating VGG16

I am using Keras to create a deep learning model. When I creating a VGG16 model, the model is created but I get the following warning.

vgg16_model = VGG16()

why this warning happens and how can I resolve this?

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
like image 469
Noran Avatar asked Feb 14 '19 07:02

Noran


2 Answers

It looks like there's an open git issue to clean this up in the keras code:

https://github.com/tensorflow/minigo/issues/740

You should be safe to ignore the warning, I don't believe you can change it without modifying the TF repo. You can disable warnings as mentioned here:

tf.logging.set_verbosity(tf.logging.ERROR)
like image 90
David Parks Avatar answered Nov 15 '22 08:11

David Parks


You can use the function below to avoid these warnings. First, you must make the appropriate imports:

 import os
 os.environ['KERAS_BACKEND']='tensorflow'
 import tensorflow as tf


def tf_no_warning():
    """
    Make Tensorflow less verbose
    """
    try:

        tf.logging.set_verbosity(tf.logging.ERROR)
        os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'

    except ImportError:
        pass

And then call the above function at the beginning of the code.

 tf_no_warning()
like image 41
Italo Gervasio Avatar answered Nov 15 '22 07:11

Italo Gervasio