Tensorflow resizing images within one batch

I am currently implementing FCN in a tensor stream that allows me to resize the input image.

I have images of really different image sizes, but, unfortunately, I can not start training with a batch size other than 1.

I use dict dict as follows:

feed_dict = {fcn.images: image_batch, fcn.labels: labels_batch, fcn.dropout_keep: dropout} result = sess.run(list(tf_ops), feed_dict=feed_dict) 

I already tried:

  • Creating image_batch and labels_batch as a numpy array, however this does not work as numpy arrays do not support variables of certain sizes.
  • Create image_batch and labels_batch as a list of numpy arrays. It seems that tensorflow is trying to call numpy.array(image_batch) .
  • Transition from tf.pack() , unfortunately, does not support other image sizes

My question is: Is there a way to solve this problem?

Thanks in advance for any suggestions or advice.

+5
source share
1 answer

So, we can close this - quoting Olivier Moindro above:

Before you dose them, you need to overlay or resize all your images to the same size.

Please note that after Olivier's answer, a new tf.image.decode_and_crop_jpeg op appeared, which can make this a little easier for this.

+1
source

All Articles