Deep learning error Lot of files open
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Joss Knight
2017-8-8
What is the actual error? What happens if you play with the 'MaxEpochs' training option, setting it to, say, 32?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!