解决问题:module ‘tensorflow._api.v2.image‘ has no attribute ‘resize_bilinear‘

tensorflow --version: 2.2.0
keras --version: 2.3.1

error:

module 'tensorflow._api.v2.image' has no attribute 'resize_bilinear'

解决方案:
将:

tf.image.resize_bilinear(x[1], size=(tf.shape(x[0])[1], tf.shape(x[0])[2]), align_corners=True)

改为:

tf.compat.v1.image.resize_bilinear(x[1], size=(tf.shape(x[0])[1], tf.shape(x[0])[2]), align_corners=True)

tf.image.resize_bilineartensorflow 1.*版本的用法

你可能感兴趣的:(python,tensorflow)