Clear Filters
Clear Filters

How to use imageDatastore function to train model on .mat file dataset?

7 views (last 30 days)
I have dataset of [2PSK,8PSK,4PSK] and its size is [2,1280,2]. I have change the input layer of the model but when i run following code i got error
miniBatchSize = 128;
valFrequency = floor(numel(auimdsTrain.Files)/miniBatchSize);
checkpointPath = pwd;
options = trainingOptions('sgdm', ...
'MiniBatchSize',miniBatchSize, ...
'MaxEpochs',100, ...
'InitialLearnRate',1e-3, ...
'Shuffle','every-epoch', ...
'ValidationData',valauimds, ...
'ValidationFrequency',valFrequency, ...
'Verbose',false, ...
'Plots','training-progress', ...
Error using nnet.cnn.TrainingOptionsSGDM (line 117)
The value of 'ValidationData' is invalid. Unable to read file:
Error in trainingOptions (line 315)
opts = nnet.cnn.TrainingOptionsSGDM(varargin{:});
Caused by:
Error using>generateReadFcnError (line 103)
Error using ReadFcn @readDatastoreImage for file:
Error using imread>get_format_info (line 545)
Unable to determine the file format.
Error in imread (line 391)
fmt_s = get_format_info(fullname);
Error in readDatastoreImage (line 12)
data = imread(filename);

Answers (1)

Sudharsana Iyengar
Sudharsana Iyengar on 5 Nov 2021
General Tutorial:
I will give you the code of image datastore
imds =imageDatastore('trainingset','IncludeSubfolders', true,...

Community Treasure Hunt

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

Start Hunting!