Hi, I'm having some problems with a bench of chest xray images. I tryed to use the code from the link below, but it did not work.
Error using trainNetwork (line 165)
Unexpected image size: All images must have the same size.
Error in chestXray1 (line 49)
net = trainNetwork(imdsTrain,layers,options);
inputSize = [224 224 1];numClasses = 2;layers = [ imageInputLayer(inputSize) convolution2dLayer(5,20) batchNormalizationLayer reluLayer fullyConnectedLayer(numClasses) softmaxLayer classificationLayer];options = trainingOptions('sgdm', ... 'MaxEpochs',3, ... 'ValidationData',imdsValidation, ... 'ValidationFrequency',30, ... 'Verbose',false, ... 'Plots','training-progress');net = trainNetwork(imdsTrain,layers,options);
Best Answer