Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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() ?

like image 244
Sai Avatar asked Sep 29 '20 11:09

Sai


1 Answers

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

In Keras v2 the method has been renamed to image_data_format

like image 161
Vidya Ganesh Avatar answered Nov 12 '22 08:11

Vidya Ganesh