I took this neural network configuration from https://arxiv.org/pdf/1603.01068.pdf and I do not understand why Matlab says that layer 8 cannot accept the data from layer 7 due to dimensions problems. These are the layers:
layers = [
imageInputLayer([block_dimensions block_dimensions 3]) %64x64x3
convolution2dLayer([4 4],32,'NumChannels',3,'Stride',1) %61x61x32
maxPooling2dLayer([2 2],'Stride',2) %31x31x32
convolution2dLayer([5 5],48,'NumChannels',32,'Stride',1) %27x27x48
maxPooling2dLayer([2 2],'Stride',2) %14x14x48
convolution2dLayer([5 5],64,'NumChannels','auto','Stride',1) %10x10x64
maxPooling2dLayer([2 2],'Stride',2) %5x5x64
convolution2dLayer([5 5],128,'NumChannels','auto','Stride',1) %1x1x128
fullyConnectedLayer(128)
reluLayer()
fullyConnectedLayer(cameras_number)
softmaxLayer()
classificationLayer
];
I've calculated all the sizes of layers output and they seem to be right. If I remove the last maxpooling layer, the network works but it performs not well as I expect.