سلام من می خوام تو matlab با استفاده از دیتاست caltech101 یک شبکه cnn با لایه های زیر(Alexnet) رو آموزش بدم .
%%url = 'http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz';
outputFolder = fullfile('C:\Users\qut\Documents\MATLAB\Examples\MY\4DeepLearningImageClassificationExample\MYDB\caltech101'); % define output folder
rootFolder = fullfile(outputFolder, '101_ObjectCategories');
imds = imageDatastore(outputFolder ,'IncludeSubfolders',true,'LabelSource','foldernames');
tbl = countEachLabel(imds)
minSetCount = min(tbl{:,2});
imds = splitEachLabel(imds, minSetCount, 'randomize');
countEachLabel(imds)
layers3 = [imageInputLayer([227 227 3]);
convolution2dLayer(11,96,'NumChannels',3,'Stride',4,'Padding',0,'BiasL2Factor',1);
reluLayer();
crossChannelNormalizationLayer(5,'K',1);
maxPooling2dLayer(2,'Stride',2,'PoolSize',3);
%%%%%%%[128 128] [48 48]
convolution2dLayer([5,5],128,'NumChannels',48,'Stride',1,'Padding',2,'BiasL2Factor',1);
%convolution2dLayer([5,5],128,'Stride',1,'Padding',2,'BiasL2Factor',1);
reluLayer();
crossChannelNormalizationLayer(5,'K',1);
maxPooling2dLayer(2,'Stride',2,'PoolSize',3);
convolution2dLayer(3,384,'NumChannels',256,'Stride',1,'Padding',1,'BiasL2Factor',1);
reluLayer();
%%%%%%%[192 192] [192 192]
convolution2dLayer(3,192,'NumChannels',192,'Stride',1,'Padding',1,'BiasL2Factor',1);
reluLayer();
%%%%%%%[128 128] [192 192]
convolution2dLayer(3,128,'NumChannels',192,'Stride',1,'Padding',1,'BiasL2Factor',1);
reluLayer();
maxPooling2dLayer(2,'Stride',2,'PoolSize',3);
%%InputSize
fullyConnectedLayer(4096,'BiasL2Factor',1);
reluLayer();
fullyConnectedLayer(4096,'BiasL2Factor',1);
reluLayer();
fullyConnectedLayer(1000,'BiasL2Factor',1);
softmaxLayer();
classificationLayer()]
options = trainingOptions('sgdm','MaxEpochs',20,'InitialLearnRate',0.001);
mynet = trainNetwork(imds,layers3,options);
اما خطای زیر رو میده
لطفا راهنماییم کنید
Error using nnet.cnn.layer.Layer>iInferSize (line 261)
Layer 6 is expected to have a different size.
Error in nnet.cnn.layer.Layer.inferParameters (line 53)
layers = iInferSize(layers, i, inputSize);
Error in trainNetwork (line 61)
layers = nnet.cnn.layer.Layer.inferParameters(layers);
من فکر میکنم خطا از تعداد فیلتر ها و تعداد کانال های لایه 6 است