成功解决AttributeError: module tensorflow.image has no attribute resize

成功解决AttributeError: module tensorflow.image has no attribute resize

 

 

目录

解决问题

解决思路

解决方法


 

解决问题

AttributeError: module 'tensorflow.image' has no attribute 'resize'

 

 

 

解决思路

属性错误:模块'tensorflow。image没有属性resize
版本不同造成的错误!

 

 

 

解决方法

    b4 = Lambda(lambda x: tf.image.resize(x, size_before[1:3],   # 20200529 本文件内此后代码均直接替代!b4 = Lambda(lambda x: tf.compat.v1.image.resize(x, size_before[1:3],
                                                    method='bilinear', align_corners=True))(b4)

替换为

#     b4 = Lambda(lambda x: tf.compat.v1.image.resize(x, size_before[1:3],   
#                                                     method='bilinear', align_corners=True))(b4)
    b4 = Lambda(lambda x: tf.image.resize_bilinear(x, size_before[1:3],   # 20200529 本文件内此后代码均直接替代!b4 = Lambda(lambda x: tf.compat.v1.image.resize(x, size_before[1:3],
                                                    align_corners=True))(b4)

哈哈,大功告成!

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章