当前位置:   article > 正文

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

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

conda环境中的Keras版本比例子程序中的版本高,因此没有K.image_data_format()这个变量

用 K.image_data_format() == 'channels_first' 替换K.image_dim_ordering() == 'th'成功解决,前面K.image_data_format() == 'channels_first'是相对于低版本的keras,后者是针对高版本的Keras,出现错误时候两者互换都试试应该都可以解决啦。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/572823
推荐阅读
相关标签
  

闽ICP备14008679号