Search code examples
matlabneural-networkclassificationresnet

Matlab: Not enough GPU memory for classification


I've trained the Resnet50 provided by Mathworks from scratch with my own categories (for now just flower types) and wanted to test it.

Although training worked without problem after I changed the MiniBatchSize to 5 instead of 10 in the trainingOptions, the classifying won't start because it says that there's not enough memory available. I'm using the test images in an imageDataset, just like during the training.

Is there any way to force CPU classification or adjust some options so that it is able to run? Any other idea is welcome as well!


Solution

  • I actually solved this myself: both classify and predict take Name-Value Pair Arguments, such as 'MiniBatchSize' or 'ExecutionEnvironment'. I was able to solve my issue using these and tinkering around with the values.