Effacer les filtres
Effacer les filtres

I am getting error while training CNN network

1 vue (au cours des 30 derniers jours)
Pasupuleti Sowgandhi
Pasupuleti Sowgandhi le 10 Juin 2021
imds = imageDatastore('FCD','IncludeSubfolders',true,'LabelSource','foldernames');
imds.ReadFcn = @readtrain;
[imdsTrain,imdsTest] = splitEachLabel(imds,0.7,'randomized');
layers=[imageInputLayer([224 224 3])
convolution2dLayer(3,8,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,16,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
fullyConnectedLayer(8)
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', ...
'Plots', 'training-progress', ...
'LearnRateSchedule', 'piecewise', ...
'LearnRateDropFactor', 0.2, ...
'LearnRateDropPeriod', 5, ...
'MiniBatchSize', 300);
options.MaxEpochs = 30;
options.InitialLearnRate=0.001;
convert=trainNetwork(imdsTrain,layers,options);
in read train I have used the resizing of the images but i am getting an error
Error using trainNetwork (line 184)
Unexpected image size: All images must have the same size.
Error in NewCnn (line 34)
convert=trainNetwork(imdsTrain,layers,options);
can anyone please help me with it how to run this program without any error.thank you in advance

Réponses (1)

Anshika Chaurasia
Anshika Chaurasia le 16 Juin 2021
Hi,
You can refer to the following discussion on similar issue:
Hope it helps!

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