I asked a similar question very recently: I want to use a caffe convolutional neural network in python for pixel-wise classification on an image sequence. Previously, I determined the maximum image size that I can process with my gpu (450x450 pixels). To process larger images, I want a nested loop like so:
function process_image_stack(image_stack, parameters):
for all images
take image apart into segments
for all image_segments
process image segment with network
stitch together output
return processed_image_stack
My problem now is the following: When I call net.forward() from a function like so:
output = processing_function(parameters)
CUDA throws an error that it is out of memory
Check failed: error == cudaSuccess (2 vs. 0) out of memory
I also get this error when I use a much smaller image as input
The problem seems to be the loop. When I "manually" loop through the images, i.e. setting variables to 0,1,2... and then calling the net on the individual ones, it works fine.
I would like to understand what the problem actually is.
Thank you very much!