Invalid training data. The output size (5) of the last layer doesn't match the number of classes (5). How to match output size??
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    nima aalizade
      
 el 16 de Dic. de 2017
  
    
    
    
    
    Comentada: Mihai Mihaela
 el 8 de Dic. de 2019
            net=vgg16();
imds = imageDatastore(fullfile('E:\','data','labels'),...
  'IncludeSubfolders',true,'FileExtensions','.dcm','LabelSource','foldernames');  
labelCount = countEachLabel(imds);
trainingNumFiles = 105;
rng(1) % For reproducibility
[trainData,testData] = splitEachLabel(imds,...
    trainingNumFiles,'randomize');
imageSize = [512 512 1];
numClasses = 5;
encoderDepth = 9;
lgraph = segnetLayers(imageSize,numClasses,encoderDepth);
plot(lgraph)
options = trainingOptions('sgdm','InitialLearnRate',1e-3, ...
      'MaxEpochs',50,'VerboseFrequency',10);
seg = trainNetwork(imds,lgraph,options)
0 comentarios
Respuesta aceptada
Más respuestas (1)
  abdulkader helwan
      
 el 25 de Dic. de 2017
        Hello.. i am having the same problem here. could u please tell me how u solved it if u did so. thanks
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




