The output size of the last layer doesn't match the number of classes

1 次查看(过去 30 天)
Hello,
I used one pretrained network (vgg16) for my set of images. Vgg16 is trainned with 11 classes.
I want to redefine the number of classes to be 6. The problem appear at the last layer: the number of classes from the last Layer is 11, not 6.
I tried something like:
layersMine(2,1).ClassWeights = length(classNames);
layerMine(2,1).ClassNames(1:6) = classNames
How can I change the number of classes from the last layer to 6?
Can I redefine the last layer (classificationLayer)? How?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by