Concatenate SSCB results from image layer with numeric CB feature data in deep learning model.

조회 수: 8(최근 30일)
John Braddock
John Braddock 2021년 11월 29일
답변: yanqi liu 2021년 12월 2일
I'm using trainNetwork() for transfer learning. I've set up a concatenation layer for combining metadata as an auxilary input with our image data to help with classifications.
I'm getting the following error.
Error using trainNetwork (line 184)
Invalid network.
Caused by:
Layer 'concat': Input size mismatch. Size of input to this layer is different from the expected input size.
Inputs to this layer:
from layer 'prob' (size 1(S) × 1(S) × 8(C) × 1(B))
from layer 'features' (size 10(C) × 1(B))
How can I address this?

답변(1개)

yanqi liu
yanqi liu 2021년 12월 2일
yes,sir,is the classes number 10?may be use
layersTransfer = net.Layers(1:end-3);
numClasses = 10;
layers = [
layersTransfer
fullyConnectedLayer(numClasses,'WeightLearnRateFactor',20,'BiasLearnRateFactor',20)
softmaxLayer
classificationLayer];

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by