简体   繁体   English

AttributeError: module 'tensorflow' has no attribute 'python' in Keras Tensorflow

[英]AttributeError: module 'tensorflow' has no attribute 'python' in Keras Tensorflow

System Info:系统信息:

  • keras 2.3.1 keras 2.3.1
  • pip 20.2.2 pip 20.2.2
  • python 3.6.10 python 3.6.10
  • tensorflow 2.3.0 tensorflow 2.3.0

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.

相关问题 AttributeError:模块“tensorflow.python.keras”没有属性“应用程序” - AttributeError: module 'tensorflow.python.keras' has no attribute 'applications' AttributeError:模块'tensorflow.python.keras'没有属性'abs' - AttributeError: module 'tensorflow.python.keras' has no attribute 'abs' AttributeError:模块“ tensorflow”没有属性“ keras” - AttributeError: module 'tensorflow' has no attribute 'keras' AttributeError: 模块 'tensorflow' 没有属性 'placeholder' 与 keras 2.2.4 tensorflow 1.14 - AttributeError: module 'tensorflow' has no attribute 'placeholder' with keras 2.2.4 tensorflow 1.14 AttributeError:Keras模型中的模块'tensorflow'没有属性'lite'到Tensorflow Lite转换-Python - AttributeError: module 'tensorflow' has no attribute 'lite' in Keras model to Tensorflow Lite convertion - Python AttributeError:模块“tensorflow”没有属性“python” - AttributeError: module 'tensorflow' has no attribute 'python' AttributeError:模块“tensorflow_core.python.keras.api._v2.keras.activations”没有属性“swish” - AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.activations' has no attribute 'swish' AttributeError:模块'tensorflow.python.keras.utils.generic_utils'没有属性'populate_dict_with_module_objects' - AttributeError: module 'tensorflow.python.keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects' AttributeError: 模块“tensorflow”在 Keras 中没有属性“name_scope” - AttributeError: module 'tensorflow' has no attribute 'name_scope' with Keras AttributeError:模块'tensorflow.keras.models'没有属性'sequential' - AttributeError: module 'tensorflow.keras.models' has no attribute 'sequential'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM