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

11 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', ...
'CheckpointPath',checkpointPath);
error:
Error using nnet.cnn.TrainingOptionsSGDM (line 117)
The value of 'ValidationData' is invalid. Unable to read file:
'D:\data-11\TIME-IQ\128APSK\frame_snr30iq_128APSK_1008.mat'.
Error in trainingOptions (line 315)
opts = nnet.cnn.TrainingOptionsSGDM(varargin{:});
Caused by:
Error using matlab.io.datastore.exceptions.decorateCustomFunctionError>generateReadFcnError (line 103)
Error using ReadFcn @readDatastoreImage for file:
D:\data-11\TIME-IQ\128APSK\frame_snr30iq_128APSK_1008.mat
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,...
'LabelSource','foldernames');

Community Treasure Hunt

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

Start Hunting!