How to solve Unable to read file: 'E:\TIME-I​Q\128QAM\f​rame_snr30​iq_128QAM_​100.mat'?

2 vues (au cours des 30 derniers jours)
john karli
john karli le 8 Nov 2021
I have dataset in .mat file and shape of dataset is [2,1280,2]. I have change the inpu layer of the model by using the deepNetworkDesigner app of matlab. All code works good but when i run below command i got the following error.
net = trainNetwork(imdsTrain,lgraph,options);
error
Error using trainNetwork (line 184)
Unable to read file: 'E:\TIME-IQ\128QAM\frame_snr30iq_128QAM_100.mat'.
Caused by:
Error using matlab.io.datastore.ImageDatastore/read (line 77)
Unable to read file: 'E:\TIME-IQ\128QAM\frame_snr30iq_128QAM_100.mat'.
Error using matlab.io.datastore.exceptions.decorateCustomFunctionError>generateReadFcnError (line 103)
Error using ReadFcn @readDatastoreImage for file:
E:\TIME-IQ\128QAM\frame_snr30iq_128QAM_100.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);
full code
imds = imageDatastore('E:\TIME-IQ\', ...
'IncludeSubfolders',true, 'FileExtensions','.mat',...
'LabelSource','foldernames');
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.7,'randomized');%%
net = lgraph_2;
net(1)
inputSize = lgraph_2.Layers(1).InputSize;
[learnableLayer,classLayer] = findLayersToReplace(lgraph_2);
[learnableLayer,classLayer]
numClasses = numel(categories(imdsTrain.Labels));
if isa(learnableLayer,'nnet.cnn.layer.FullyConnectedLayer')
newLearnableLayer = fullyConnectedLayer(numClasses, ...
'Name','new_fc', ...
'WeightLearnRateFactor',10, ...
'BiasLearnRateFactor',10);
elseif isa(learnableLayer,'nnet.cnn.layer.Convolution2DLayer')
newLearnableLayer = convolution2dLayer(1,numClasses, ...
'Name','new_conv', ...
'WeightLearnRateFactor',10, ...
'BiasLearnRateFactor',10);
end
lgraph_2 = replaceLayer(lgraph_2,learnableLayer.Name,newLearnableLayer);
newClassLayer = classificationLayer('Name','new_classoutput');
lgraph = replaceLayer(lgraph_2,classLayer.Name,newClassLayer);
miniBatchSize = 128;
valFrequency = floor(numel(imdsTrain.Files)/miniBatchSize);
checkpointPath = pwd;
options = trainingOptions('sgdm', ...
'MiniBatchSize',miniBatchSize, ...
'MaxEpochs',100, ...
'InitialLearnRate',1e-3, ...
'Shuffle','every-epoch', ...
'ValidationData',imdsValidation, ...
'ValidationFrequency',valFrequency, ...
'Verbose',false, ...
'Plots','training-progress', ...
'CheckpointPath',checkpointPath);
net = trainNetwork(imdsTrain,lgraph,options);
Please help

Réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by