Why is the error thrown: Inputs to concatenations layer must have consistent formats.
Show older comments
lgraph = layerGraph();
tempLayers = imageInputLayer([90 90 3],"Name","imageinput_1");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = imageInputLayer([90 90 3],"Name","imageinput_2");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = imageInputLayer([90 90 3],"Name","imageinput_3");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(3,"Name","depthcat")
convolution2dLayer([3 3],32,"Name","conv_1","Padding","same")
batchNormalizationLayer("Name","batchnorm_1")
reluLayer("Name","relu_1")
maxPooling2dLayer([5 5],"Name","maxpool","Padding","same")
convolution2dLayer([3 3],32,"Name","conv_2","Padding","same")
batchNormalizationLayer("Name","batchnorm_2")
reluLayer("Name","relu_2")
fullyConnectedLayer(3,"Name","fc")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
sequenceInputLayer(1,"Name","sequence")
lstmLayer(128,"Name","lstm")
dropoutLayer(0.5,"Name","dropout")
fullyConnectedLayer(3,"Name","fc1")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
concatenationLayer(1,2,"Name","concat")
softmaxLayer("Name","softmax")
classificationLayer("Name","classoutput")];
lgraph = addLayers(lgraph,tempLayers);
% clean up helper variable
clear tempLayers;
lgraph = connectLayers(lgraph,"imageinput_1","depthcat/in1");
lgraph = connectLayers(lgraph,"imageinput_2","depthcat/in2");
lgraph = connectLayers(lgraph,"imageinput_3","depthcat/in3");
lgraph = connectLayers(lgraph,"fc","concat/in1");
lgraph = connectLayers(lgraph,"fc1","concat/in2");
plot(lgraph);

Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!