[英]Keras + tensorflow gives the error “no attribute 'control_flow_ops'”
[英]Tensorflow: AttributeError: module 'tensorflow.python' has no attribute 'control_flow_ops'
我正在使用 keras 版本1.0.8
和 tensorflow 版本0.12.0
。 我跑了python image_zooms_training.py -n 0
然后它拋出
`AttributeError:模塊'tensorflow.python'沒有屬性'control_flow_ops'
請告訴我如何解決。 感謝您的幫助。
以下進口作品。 您需要更新該行
from tensorflow.python.ops import control_flow_ops
官方 TensorFlow 支持不鼓勵使用 tf.python.*,因為它是私有的並且僅用於開發目的。 雖然它在某些情況下可能有效,但在許多其他情況下它會“突然中斷”。
相反,請嘗試在刪除 .python 部分的情況下導入 tensorflow,例如:
from tensorflow.keras.models import Sequential
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.