问题1:解决问题: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)
问题2:解决问题module ‘tensorflow’ has no attribute ‘is_nan’
x = tf.is_nan(x)
改为
x = tf.math.is_nan(x)
问题3:解决问题解决AttributeError: module ‘keras.backend’ has no attribute ‘control_flow_ops’
_, ignore_mask = K.control_flow_ops.while_loop(lambda b,*args: b<m, loop_body, [0, ignore_mask])
改为
_, ignore_mask = tf.while_loop(lambda b,*args: b<m, loop_body, [0, ignore_mask])
问题4:'Model’object has no attribute '_get_distribution_strategy’的一种解决方案
解决方法
问题5:NotFoundError: Failed to create a directory: logs/
解决方法