Keras + TensorFlow: "tensor flow module does not have the attribute" merge_all_summaries ""

Very similar to Keras + tensorflow throws the "no attribute" control_flow_ops "error from the conversion auto-encoder example from https://blog.keras.io/building-autoencoders-in-keras.html I get an error

[...]lib/python3.5/site-packages/keras/callbacks.py in _set_model(self, model)
    478                     tf.histogram_summary('{}_out'.format(layer),
    479                                          layer.output)
--> 480         self.merged = tf.merge_all_summaries()
    481         if self.write_graph:
    482             if parse_version(tf.__version__) >= parse_version('0.8.0'):

AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries'

I tried

import tensorflow as tf
tf.merge_all_summaries = tf

but it didn’t work. What should I do?

The object AttributeError: 'module' is not 'merge_all_summaries' attribute , the error mentioned. I also have version 1.0.0. But what is the solution? I do not want to lower TensorFlow.

+4
source share
2

Make42 , , > , TensorFlow 1.0. , , Keras. , Keras 2017 , Keras 1.2.2 , .

+5

. https://www.tensorflow.org/install/migration. ,

- tf.merge_summary
    - should be renamed to tf.summary.merge
- tf.train.SummaryWriter
    - should be renamed to tf.summary.FileWriter

( SummaryWriter.)

import tensorflow as tf
tf.merge_all_summaries = tf

import tensorflow as tf
tf.merge_all_summaries = tf.summary.merge_all
tf.train.SummaryWriter = tf.summary.FileWriter
+2

Source: https://habr.com/ru/post/1670913/


All Articles