【问题标题】:AttributeError: module 'keras.backend' has no attribute 'common'AttributeError:模块 'keras.backend' 没有属性 'common'
【发布时间】:2021-01-14 23:44:56
【问题描述】:

我试图执行一些项目。但我有一个attribute error。 我检查了我的 Tensorflow 和 Keras 版本。

Name: tensorflow
Version: 2.3.1
Name: Keras
Version: 2.4.3
Summary: Deep Learning for humans
python 3.8.2 

代码在这里。

self.dim_ordering = K.common.image_dim_ordering()

错误信息:

self.dim_ordering = K.common.image_dim_ordering()
AttributeError: module 'keras.backend' has no attribute 'common'

可以使用K.image_data_format() 代替k.common.image_dim_ordering() 吗?

【问题讨论】:

    标签: python tensorflow keras tensorflow2.0 keras-2


    【解决方案1】:

    是的。可以用k.image_data_format()

    在 Keras v2 中,该方法已重命名为 image_data_format

    【讨论】:

      猜你喜欢
      • 2020-01-22
      • 2020-03-08
      • 2020-01-07
      • 1970-01-01
      • 2023-01-13
      • 1970-01-01
      • 2021-01-14
      • 2018-04-14
      • 2019-02-18
      相关资源
      最近更新 更多