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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With