i am using tensorflow in image classification problem but i am feeling lost in the part related to reshaping input which in this case an image
i use misc to take image and resize it
image = misc.imread("actor.jpg")
resize_image = misc.imresize(image,[224, 224], interp='nearest')
and image shape is
(224, 224, 3)
i get an error related to image incompatible
ValueError: Cannot feed value of shape (224, 224, 3) for Tensor u'input_image_2:0', which has shape '(?, 224, 224, 3)'
what is meant by ? and how to do resizing correctly
thanks in-advance
Many image functions expect batches containing multiple images. The first dimension identifies an image's index in the batch. If you only have one image to process, you can reshape it with the following code:
resize_image = tf.reshape(image, [-1, 224, 224, 3])
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