testmodel.py:None (testmodel.py)\ntestmodel.py:19: in \n K.set_image_dim_ordering('th')\nE AttributeError: module 'keras.backend' has no attribute 'set_image_dim_ordering'\n这段错误是由于Keras版本的更改导致的。之前的版本中使用了K.set_image_dim_ordering('th')来设置图像维度的顺序,但在新的版本中已经被移除了。\n\n要解决这个问题,你可以使用以下代码来设置图像维度的顺序:\n\npython\nfrom keras import backend as K\n\nK.set_image_data_format('channels_first')\n\n\n将K.set_image_dim_ordering('th')替换为上述代码即可修复错误。


原文地址: https://www.cveoy.top/t/topic/pH5y 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录