MATLAB Answers

Deep learning error Lot of files open

10 views (last 30 days)
Venkat R
Venkat R on 8 Aug 2017
Commented: Ronak Patel on 27 May 2020
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, ...
img = readimage(trainDigitData,1);
digitDatasetPath = fullfile('E:\Database\resize\val');
testDigitData = imageDatastore(digitDatasetPath, ...
layers = [imageInputLayer([size(img,1) size(img,2) 1]);
options = trainingOptions('sgdm','MaxEpochs',30,'InitialLearnRate',0.0001,'ExecutionEnvironment','cpu');
convnet = trainNetwork(trainDigitData,layers,options);
YTest = classify(convnet,testDigitData);
TTest = testDigitData.Labels;
accuracy = sum(YTest == TTest)/numel(TTest)
disp('All over')
Ronak Patel
Ronak Patel on 27 May 2020
i tried your code so i ask one question how to decided fully connected layer

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by