I am getting error while training CNN network
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
Anshika Chaurasia
2021 年 6 月 16 日
Hi,
You can refer to the following discussion on similar issue:
Hope it helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!