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

4 ビュー (過去 30 日間)
john karli
john karli 2021 年 11 月 5 日
回答済み: Sudharsana Iyengar 2021 年 11 月 5 日
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);

回答 (1 件)

Sudharsana Iyengar
Sudharsana Iyengar 2021 年 11 月 5 日
General Tutorial:
I will give you the code of image datastore
imds =imageDatastore('trainingset','IncludeSubfolders', true,...
'LabelSource','foldernames');

カテゴリ

Help Center および File ExchangePattern Recognition and Classification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by