change tf.image.decode_image to tf.io.decode_image

tf.image.decode_image to tf.io.decode_image for API migration and consistency.
Please see https://www.tensorflow.org/api_docs/python/tf/io/decode_image
This commit is contained in:
angusluo 2020-03-13 12:06:55 +08:00 committed by GitHub
parent d21998f3eb
commit e1c701e280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,7 +240,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",