The output size of the last layer doesn't match the number of classes
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!