Keras + TensorFlow:“模块'tensorflow'没有属性'merge_all_summaries'" [英] Keras + TensorFlow: “module 'tensorflow' has no attribute 'merge_all_summaries''”
问题描述
非常类似于 Keras + tensorflow给出了错误没有属性'control_flow_ops'" ,摘自 https://blog.keras.io/building-autoencoders-in-keras.html 我收到了错误
Very similar to Keras + tensorflow gives the error "no attribute 'control_flow_ops'", from the Convolutional autoencoder example from https://blog.keras.io/building-autoencoders-in-keras.html I get the 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'
我尝试过
import tensorflow as tf
tf.merge_all_summaries = tf
但是没有用.我该怎么办?
but that did not work. What should I do?
在> AttributeError:'module'对象没有属性' merge_all_summaries'该错误被提及.我也有版本1.0.0.但是,解决方案是什么?我不想降级TensorFlow.
In AttributeError: 'module' object has no attribute 'merge_all_summaries' the error is mentioned. I also have the version 1.0.0. But what is the solution? I don't want to downgrade TensorFlow.
推荐答案
Make42绝对正确,因为它们在他们的答案中描述的更改<必须进行/a>才能迁移代码库以与TensorFlow 1.0一起使用.但是,您看到的错误在Keras库本身中.幸运的是,这些错误已在Keras代码库自2017年1月起中已得到修复,因此升级至 Keras 1.2.2 或更高版本将为您解决该错误.
Make42 is absolutely correct that the changes they describe in their answer must be made in order to migrate a codebase to work with TensorFlow 1.0. However, the errors you are seeing are in the Keras library itself. Fortunately, these errors have been fixed in the Keras codebase since January 2017, so upgrading to Keras 1.2.2 or later will fix the error for you.
这篇关于Keras + TensorFlow:“模块'tensorflow'没有属性'merge_all_summaries'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!