Keras: TensorBoard callback warning

Created on 17 Dec 2016  Â·  17Comments  Â·  Source: keras-team/keras

Using TensorBoard histogram_freq feature cause a lot of warnings like:

Instructions for updating:
Please switch to tf.summary.histogram. Note that tf.summary.histogram uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on their scope.
WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/Keras-1.1.2-py3.5.egg/keras/callbacks.py:525 in _set_model.: histogram_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.

Also, turning it off cause another warning:
Please switch to tf.summary.merge. WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/keras/callbacks.py:536 in _set_model.: SummaryWriter.__init__ (from tensorflow.python.training.summary_io) is deprecated and will be removed after 2016-11-30. Instructions for updating: Please switch to tf.summary.FileWriter. The interface and behavior is the same; this is just a rename.

stale

Most helpful comment

@fchollet just upgraded to keras 1.2.2. this is still an issue.

All 17 comments

Could you wrap the messages with ``instead of? It's not very readable.

The warnings are tensorflow warning messages for some deprecation methods. What's the problem exactly? It seems like more about tensorflow than keras though.

I've had a similar issue with tflearn. It seems like something has deprecated on the tensorflow side which is still being called by keras.

Here's a snippet of my code. I'm training a basic autoencoder on MNIST.

>autoencoder.fit(x_train, x_train,
                nb_epoch=50,
                batch_size=256,
                shuffle=True,
                validation_data=(x_test, x_test), 
                callbacks=[TensorBoard(log_dir='/tmp/autoencoder')])

Train on 60000 samples, validate on 10000 samples
WARNING:tensorflow:From /Users/vwarmerdam/miniconda2/envs/ds/lib/python2.7/site-packages/keras/callbacks.py:517 in _set_model.: merge_all_summaries (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.merge_all.
WARNING:tensorflow:From /Users/vwarmerdam/miniconda2/envs/ds/lib/python2.7/site-packages/tensorflow/python/ops/logging_ops.py:264 in merge_all_summaries.: merge_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.merge.
WARNING:tensorflow:From /Users/vwarmerdam/miniconda2/envs/ds/lib/python2.7/site-packages/keras/callbacks.py:521 in _set_model.: __init__ (from tensorflow.python.training.summary_io) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.FileWriter. The interface and behavior is the same; this is just a rename.
WARNING:tensorflow:Error encountered when serializing data_augmentation.
Type is unsupported, or the types of the items don't match field type in CollectionDef.
'NoneType' object has no attribute 'name'
WARNING:tensorflow:Error encountered when serializing data_preprocessing.
Type is unsupported, or the types of the items don't match field type in CollectionDef.
'NoneType' object has no attribute 'name'
WARNING:tensorflow:Error encountered when serializing summary_tags.
Type is unsupported, or the types of the items don't match field type in CollectionDef.
'dict' object has no attribute 'name'
Epoch 1/50
60000/60000 [==============================] - 2s - loss: 0.3681 - val_loss: 0.2720
Epoch 2/50
60000/60000 [==============================] - 1s - loss: 0.2643 - val_loss: 0.2534
Epoch 3/50
60000/60000 [==============================] - 1s - loss: 0.2426 - val_loss: 0.2302
....

It gives many warnings, but tensorboard (and the tensorflow backend) still seems to be working as far as I can tell.

This should not be happening with the latest Keras version (from Github).

@fchollet I just pulled and installed fdb20dbc7efcde720b8728afbff971ca26c99680 and I'm still seeing this error (from 7 hours before time of writing)

It seems like https://github.com/fchollet/keras/pull/4700 is what was supposed to fix this?

With the caveat that I haven't tested this on anything but HEAD, I can say that the warnings vanish when using (roughly):

if hasattr(tf, 'summary'):
    tf.summary.histogram(...)
else:
    tf.summary_histogram(...)

instead of

if hasattr(tf, 'histogram_summary'):
    tf.histogram_summary(...)
else:
    tf.summary.histogram()

4989 changed the version checking from if tf.__version__ == ... to attribute detection (if hasattr(tf, 'histogram_summary')).

Currently it defaults to the old summary operations (which are apparently still present in tf-0.12), and that's there the deprecation warnings come from.
not sure why they didn't do it the other way around, i.e. checking if the new operations (like `tf.summary.histogram) exist, otherwise fall bac kto the old ops.

@fchollet just upgraded to keras 1.2.2. this is still an issue.

@isaacgerg I'm seeing this issue as well using TensorFlow v0.12.x. Not sure if this also happens w/ TensorFlow v1.0

@isaacgerg did you try applying #5391? Interested to see if that helps.

no i have not. Since my current setup is working, ill wait until the PR
gets merged before updating.

On Fri, Feb 17, 2017 at 12:43 PM, Andrew Hundt notifications@github.com
wrote:

@isaacgerg https://github.com/isaacgerg did you try applying #5391
https://github.com/fchollet/keras/pull/5391? Interested to see if that
helps.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fchollet/keras/issues/4754#issuecomment-280717588,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALarqxYlpezEmTMmxjKzESrBOcHmhQFbks5rddxGgaJpZM4LP5no
.

I'm holding off on updating to tf 1.0 until i know it works with keras OK.

On Fri, Feb 17, 2017 at 12:43 PM, Michael Dietz notifications@github.com
wrote:

@isaacgerg https://github.com/isaacgerg I'm seeing this issue as well
using TensorFlow v0.12.x. Not sure if this also happens w/ TensorFlow v1.0

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fchollet/keras/issues/4754#issuecomment-280717575,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALarqxMTYLA4rh_uQjDzumPZwix_4FsEks5rddxEgaJpZM4LP5no
.

Is this issue resolved anywhere in Github? Please let me know!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.

I did a "fresh pull" and still see the error. Does anyone else?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.

Was this page helpful?
0 / 5 - 0 ratings