Loading

Error : keras.backend has no attribute 'set_image_dim_ordering'

情况一

如果你是下面这种情况

from keras import backend as K

K.set_image_dim_ordering('th')

碰到错误为

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

改为

K.set_image_data_format('channels_first')

情况二

from keras import backend as K

K.set_image_dim_ordering('tf')

改为

K.set_image_data_format('channels_last')
posted @ 2022-04-22 11:31  Christopher_James  阅读(151)  评论(0编辑  收藏  举报