When I run trainNetwork function with CNN(deep neural network), 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)'.
Error: nnet.internal.cnn.layer.FullyConnected/forward (line 73)
Z = nnet.internal.cnngpu.convolveForward2D(…
Error: nnet.internal.cnn.SeriesNetwork/forwardPropagation (line 133)
[layerOutputs{currentLayer}, memory{currentLayer}] = this.Layers{currentLayer}.forward( layerOutputs{currentLayer-1} );
Error: nnet.internal.cnn.SeriesNetwork/gradients (line 73)
[layerOutputs, memory] = this.forwardPropagation(data);
Error: nnet.internal.cnn.Trainer/train (line 58)
[gradients, miniBatchLoss, miniBatchAccuracy] = net.gradients(X, Y);
Error: trainNetwork (line 92)
trainedNet = trainer.train(trainedNet, dispatcher);
Error: samp (line 26)
net = trainNetwork(XTrain,TTrain,layers,opts);
Best Answer