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?