I want to resize images from 28*28 to 32*32,used tf.image.resize_images(x_train, (32, 32)).It returns AttributeError: module 'tensorflow_core._api.v2.image' has no attribute 'resize_images'.The version of tersorflow is 2.0.0. How can I fix it?
I want to resize images from 28*28 to 32*32,used tf.image.resize_images(x_train, (32, 32)).It returns AttributeError: module 'tensorflow_core._api.v2.image' has no attribute 'resize_images'.The version of tersorflow is 2.0.0. How can I fix it?
It should be tf.image.resize See the updated doc https://www.tensorflow.org/api_docs/python/tf/image/resize
import tensorflow as tf
img_final = tf.image.resize_images(img_tensor, [192, 192])
You get the following exception:
AttributeError: module 'tensorflow._api.v2.image' has no attribute 'resize_images'
import tensorflow as tf
import tensorflow as tf
img_final = tf.image.resize(img_tensor, [192, 192])
For more info please check here: https://www.google.com/amp/s/better-coding.com/solved-tensorflow-attributeerror-module-tensorflow-_api-v2-image-has-no-attribute-resize_images/amp/
tf.image.resize(trainX, size=(32,32))
More info on https://www.tensorflow.org/api_docs/python/tf/image/resize
Note that trainX should be a 4D or 3D tensor
The function has been renamed to resize. You should change your code like it was done below. It worked for me.
import tensorflow as tf
img_final = tf.image.resize(img_tensor, [192, 192])
The function has been renamed into resize. The code can be changed as follows;
import tensorflow as tf
img_A=tf.image.resize(................)
According to TensorFlow Core v2.7.0 docs you should use tf.compat.v1.image.resize_bilinear instead of tf.image.resize_bilinear