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

조회 수: 11 (최근 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 CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by