Hey, guys! Thank you for your answers!
@Przemek
That's right! My python layer receives a .txt with two image paths and a label per line. It loads and preprocesses both images and join them into one by performing some operations. This is repeated until I have a number of images equal to the size of my batch.
The batch is forwarded through the network and, at the end of it, a Softmax layer give me the probability of a pair being of one of two classes.
The thing is... outside of my custom layer, there isn't a way of knowing when to stop (when all the pairs are processed). Or is there?
What I'm doing is finding out how many iterations I need to run in order to process all my data (an epoch) and inserting it in the caffe test command.
@Barry
If I set the number of iterations to 1, it will only process one batch. Since I have limited memory, I can't load all my data in a single batch.