diff --git a/tensorflow/python/keras/backend.py b/tensorflow/python/keras/backend.py index 11c855aa070..6dc31a42a84 100644 --- a/tensorflow/python/keras/backend.py +++ b/tensorflow/python/keras/backend.py @@ -2610,9 +2610,11 @@ def resize_images(x, height_factor, width_factor, data_format, if data_format == 'channels_first': x = permute_dimensions(x, [0, 2, 3, 1]) if interpolation == 'nearest': - x = image_ops.resize_nearest_neighbor(x, new_shape) + x = image_ops.resize_images_v2( + x, new_shape, method=image_ops.ResizeMethod.NEAREST_NEIGHBOR) elif interpolation == 'bilinear': - x = image_ops.resize_bilinear(x, new_shape) + x = image_ops.resize_images_v2(x, new_shape, + method=image_ops.ResizeMethod.BILINEAR) else: raise ValueError('interpolation should be one ' 'of "nearest" or "bilinear".') diff --git a/tensorflow/python/ops/image_ops_impl.py b/tensorflow/python/ops/image_ops_impl.py index c6e11edb347..f1164d5adbd 100644 --- a/tensorflow/python/ops/image_ops_impl.py +++ b/tensorflow/python/ops/image_ops_impl.py @@ -1209,7 +1209,7 @@ def resize_images_v2(images, `tf.image.resize_with_pad`. When 'antialias' is true, the sampling filter will anti-alias the input image - as well as interpolate. When downsampling an image with [anti-aliasing]( + as well as interpolate. When downsampling an image with [anti-aliasing]( https://en.wikipedia.org/wiki/Spatial_anti-aliasing) the sampling filter kernel is scaled in order to properly anti-alias the input image signal. 'antialias' has no effect when upsampling an image.