pythontensorflowkerastensorflow2.0keras-2

AttributeError: module 'keras.backend' has no attribute 'common'


I tried to execute some project. But I've got an attribute error. I checked my Tensorflow and Keras version.

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

The code is here.

self.dim_ordering = K.common.image_dim_ordering()

Error message:

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

Is it okay to use K.image_data_format() instead of k.common.image_dim_ordering() ?


Solution

  • Yes. It is okay to use k.image_data_format()

    In Keras v2 the method has been renamed to image_data_format