Varying Image sizes in Tensorflow Malaria dataset | Dealing with unclean tensorflow data
#Here image is your batch.
# Add &quot;batch&quot; and &quot;channels&quot; dimensions
image = image[tf.newaxis, ..., tf.newaxis]
image.shape.as_list()  # [batch, height, width, channels]


tf.image.resize(image, [height,width])[0,...,0].numpy()