Deep learning error Lot of files open
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi
I am training a 6 layers CNN for 3 class classification. Each image is resized to [90 70]. Total 4000 images for training. My PC is with i7, 32GB RAM. But no GPU. When I am training for more than 30 epochs, I am getting error that too many files are open. In the same session, I cannot run even one epoch. See attached snapshot. But, If I close the Matlab session and rerun, Program once again upto 30 epochs only. The RAM is also not 50% full. Why am I getting this error and how to fix it.
Thank you for help in advance.
with regards Ramana
PS: Code is as follows
%CNN for train val sets
digitDatasetPath = fullfile('E:\Database\resize\train');
trainDigitData = imageDatastore(digitDatasetPath, ...
'IncludeSubfolders',true,'LabelSource','foldernames');
img = readimage(trainDigitData,1);
digitDatasetPath = fullfile('E:\Database\resize\val');
testDigitData = imageDatastore(digitDatasetPath, ...
'IncludeSubfolders',true,'LabelSource','foldernames');
layers = [imageInputLayer([size(img,1) size(img,2) 1]);
convolution2dLayer(5,20);
reluLayer();
maxPooling2dLayer(2,'Stride',2);
fullyConnectedLayer(3);
softmaxLayer();
classificationLayer()];
options = trainingOptions('sgdm','MaxEpochs',30,'InitialLearnRate',0.0001,'ExecutionEnvironment','cpu');
rng('default')
convnet = trainNetwork(trainDigitData,layers,options);
YTest = classify(convnet,testDigitData);
TTest = testDigitData.Labels;
accuracy = sum(YTest == TTest)/numel(TTest)
disp('All over')
2 Kommentare
Joss Knight
am 8 Aug. 2017
What is the actual error? What happens if you play with the 'MaxEpochs' training option, setting it to, say, 32?
Ronak Patel
am 27 Mai 2020
i tried your code so i ask one question how to decided fully connected layer
Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!