Veer
Veer

Reputation: 1

How to fix "AttributeError: module 'keras.backend' has no attribute.."

Code:

from keras import backend as K
K.set_image_dim_ordering('tf')

Error:

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

Upvotes: 0

Views: 4773

Answers (1)

Seraph
Seraph

Reputation: 444

You are importing backend from keras as k. Your code should read: keras.k Or you should import the module like this:


from keras import backend 

Upvotes: 1

Related Questions