Why do I get an out-of-memory error while training a deep learning network?

I am trying to train a convolutional neural network using the Deep Learning Toolbox. When I run the "trainnet" function, I get the following error.
Error using nnet.internal.cnngpu.convolveForward2D 
Out of memory on device. To view more detail about available memory on the GPU, use 'gpuDevice()'. If the problem persists, reset the GPU by calling 'gpuDevice(1)'.
Why do I receive this error, and how can I resolve it?

 Accepted Answer

This error indicates that the GPU does not have sufficient memory to complete the network training. 
You can reduce memory requirements for training by decreasing the value of the "MiniBatchSize" training option or reducing the size of your training dataset.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!