diff --git a/tensorflow/core/api_def/base_api/api_def_DecodeGif.pbtxt b/tensorflow/core/api_def/base_api/api_def_DecodeGif.pbtxt index 75278f3c806..68438bc8114 100644 --- a/tensorflow/core/api_def/base_api/api_def_DecodeGif.pbtxt +++ b/tensorflow/core/api_def/base_api/api_def_DecodeGif.pbtxt @@ -21,6 +21,6 @@ uncompressed by running: convert $src.gif -coalesce $dst.gif This op also supports decoding JPEGs and PNGs, though it is cleaner to use -`tf.image.decode_image`. +`tf.io.decode_image`. END } diff --git a/tensorflow/core/api_def/base_api/api_def_DecodeJpeg.pbtxt b/tensorflow/core/api_def/base_api/api_def_DecodeJpeg.pbtxt index b9521370d35..e6147a00412 100644 --- a/tensorflow/core/api_def/base_api/api_def_DecodeJpeg.pbtxt +++ b/tensorflow/core/api_def/base_api/api_def_DecodeJpeg.pbtxt @@ -75,6 +75,6 @@ downscaling the image later. This op also supports decoding PNGs and non-animated GIFs since the interface is -the same, though it is cleaner to use `tf.image.decode_image`. +the same, though it is cleaner to use `tf.io.decode_image`. END } diff --git a/tensorflow/core/api_def/base_api/api_def_DecodePng.pbtxt b/tensorflow/core/api_def/base_api/api_def_DecodePng.pbtxt index 63404db8009..450de43751f 100644 --- a/tensorflow/core/api_def/base_api/api_def_DecodePng.pbtxt +++ b/tensorflow/core/api_def/base_api/api_def_DecodePng.pbtxt @@ -34,6 +34,6 @@ If needed, the PNG-encoded image is transformed to match the requested number of color channels. This op also supports decoding JPEGs and non-animated GIFs since the interface -is the same, though it is cleaner to use `tf.image.decode_image`. +is the same, though it is cleaner to use `tf.io.decode_image`. END } diff --git a/tensorflow/core/kernels/decode_image_op.cc b/tensorflow/core/kernels/decode_image_op.cc index ffa6ca5c59a..3f878ac6b95 100644 --- a/tensorflow/core/kernels/decode_image_op.cc +++ b/tensorflow/core/kernels/decode_image_op.cc @@ -317,8 +317,8 @@ class DecodeImageOp : public OpKernel { } else { status = errors::InvalidArgument( "Got ", num_frames, " frames, but animated gifs ", - "can only be decoded by tf.image.decode_gif or ", - "tf.image.decode_image"); + "can only be decoded by tf.io.decode_gif or ", + "tf.io.decode_image"); } if (!status.ok()) { VLOG(1) << status; diff --git a/tensorflow/examples/label_image/label_image.py b/tensorflow/examples/label_image/label_image.py index f675ec35ec8..8828b90adc3 100644 --- a/tensorflow/examples/label_image/label_image.py +++ b/tensorflow/examples/label_image/label_image.py @@ -44,15 +44,13 @@ def read_tensor_from_image_file(file_name, output_name = "normalized" file_reader = tf.read_file(file_name, input_name) if file_name.endswith(".png"): - image_reader = tf.image.decode_png( - file_reader, channels=3, name="png_reader") + image_reader = tf.io.decode_png(file_reader, channels=3, name="png_reader") elif file_name.endswith(".gif"): - image_reader = tf.squeeze( - tf.image.decode_gif(file_reader, name="gif_reader")) + image_reader = tf.squeeze(tf.io.decode_gif(file_reader, name="gif_reader")) elif file_name.endswith(".bmp"): - image_reader = tf.image.decode_bmp(file_reader, name="bmp_reader") + image_reader = tf.io.decode_bmp(file_reader, name="bmp_reader") else: - image_reader = tf.image.decode_jpeg( + image_reader = tf.io.decode_jpeg( file_reader, channels=3, name="jpeg_reader") float_caster = tf.cast(image_reader, tf.float32) dims_expander = tf.expand_dims(float_caster, 0) diff --git a/tensorflow/lite/g3doc/models/style_transfer/overview.ipynb b/tensorflow/lite/g3doc/models/style_transfer/overview.ipynb index e71b07661a0..0dbbcbb6ccb 100644 --- a/tensorflow/lite/g3doc/models/style_transfer/overview.ipynb +++ b/tensorflow/lite/g3doc/models/style_transfer/overview.ipynb @@ -250,7 +250,7 @@ "# Function to load an image from a file, and add a batch dimension.\n", "def load_img(path_to_img):\n", " img = tf.io.read_file(path_to_img)\n", - " img = tf.image.decode_image(img, channels=3)\n", + " img = tf.io.decode_image(img, channels=3)\n", " img = tf.image.convert_image_dtype(img, tf.float32)\n", " img = img[tf.newaxis, :]\n", "\n", diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py index d3df8cb973d..266413cc96e 100644 --- a/tensorflow/python/framework/ops.py +++ b/tensorflow/python/framework/ops.py @@ -605,7 +605,7 @@ class Tensor(_TensorLike): ```python _, image_data = tf.compat.v1.TFRecordReader(...).read(...) - image = tf.image.decode_png(image_data, channels=3) + image = tf.io.decode_png(image_data, channels=3) # The height and width dimensions of `image` are data dependent, and # cannot be computed without executing the op.