2

I have to build a network that receives images of different sizes. I don't want to resize or crop so i am using a fully convolutional network.

The problem is that i can't pre-create minibatchs because of the different sizes of each image.

One solution would be to take the biggest image in the intended mini-batch and zero-pad all the other images to fit the same size. However that is not efficient in time and memory, especially since the images vary in size significantly (30px to 3000px even).

Another solution which i am using right now is to create mini-batchs of 1 that of course solves the problem of different sizes but it is no good for convergence.

So the question is whether Keras offers some method to collect gradients from several inputs and only then take a learning step?

Alon
  • 293
  • 2
  • 6
  • Could you provide the definition of your function? – Marcin Możejko Jun 09 '17 at 21:41
  • @MarcinMożejko I'm not sure that i understand your question. I am looking for a way to train a model by inputting images one by one (not in a tensor) but still have Keras regard every 10 single images as a batch – Alon Jun 12 '17 at 14:51

0 Answers0