我试着运行以下代码来测试我的TensorBoard,但是,当我运行程序时,有一个错误说:
'module' object has no attribute 'scalar_summary'
Run Code Online (Sandbox Code Playgroud)
我想知道如何解决这个问题,谢谢.
以下是系统信息:
我想第一次运行keras.我安装了以下模块:
pip install keras --user
pip install tensorflow --user
Run Code Online (Sandbox Code Playgroud)
然后尝试运行https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py.
但它给了我:
AttributeError: 'module' object has no attribute 'control_flow_ops'
Run Code Online (Sandbox Code Playgroud)
这些是我正在使用的版本.
print tensorflow.__version__
0.11.0rc0
print keras.__version__
1.1.0
Run Code Online (Sandbox Code Playgroud)
我能做些什么才能让keras与tensorflow一起运行?
非常相似,Keras + tensorflow给出了错误“没有属性‘control_flow_ops’”,从卷积自动编码例如从https://blog.keras.io/building-autoencoders-in-keras.html我得到的错误
[...]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'
Run Code Online (Sandbox Code Playgroud)
我试过了
import tensorflow as tf
tf.merge_all_summaries = tf
Run Code Online (Sandbox Code Playgroud)
但这没有用。我该怎么办?
在AttributeError中:“模块”对象没有属性“ merge_all_summaries”,其中提到了错误。我也有版本1.0.0。但是,解决方案是什么?我不想降级TensorFlow。