testmodelpyNone testmodelpytestmodelpy19 in module Kset_image_dim_orderingthE AttributeError module kerasbackend has no attribute set_image_dim_ordering这段错误是什么意思 应该怎么修改
这段错误是由于Keras版本的更改导致的。之前的版本中使用了K.set_image_dim_ordering('th')来设置图像维度的顺序,但在新的版本中已经被移除了。
要解决这个问题,你可以使用以下代码来设置图像维度的顺序:
from keras import backend as K
K.set_image_data_format('channels_first')
将K.set_image_dim_ordering('th')替换为上述代码即可修复错误。
原文地址: http://www.cveoy.top/t/topic/hYYh 著作权归作者所有。请勿转载和采集!