[英]AttributeError: module 'tensorflow' has no attribute 'python' in Keras Tensorflow
System Info:系统信息:
I am working on a siamese algorithm on keras tensorflow backend.我正在 keras tensorflow 后端开发暹罗算法。 I have imported keras backend as follow and it shows above attribute error.
我已经按照以下方式导入了 keras 后端,它显示了以上属性错误。 What could be the reason for that and how to avoid this issue?
这可能是什么原因以及如何避免这个问题?
import tensorflow.python.keras.backend as K
AttributeError: module 'tensorflow' has no attribute 'python'
AttributeError:模块“tensorflow”没有属性“python”
It means that within the module 'tensorflow', no attribute named 'python' exists.这意味着在模块“tensorflow”中,不存在名为“python”的属性。 You don't really need to import python as a module I believe.
我相信您真的不需要导入 python 作为模块。 Try this:
试试这个:
import tensorflow.keras.backend as K
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.