Semantic Segmentation without Data Store Object

Hi everyone, I have a problem using categorical response. I dont want to use data store object to prepare data. I have Itrn NxNx3XM image store and trn_gnd NxNx1xM pixel label matrix which each elements are 0 and 1; I translated numerical [0,1] to string "b","c" labels.
classNames = ["b","c"];
pxLayer = pixelClassificationLayer('Name','labels','ClassNames',classNames, 'ClassWeights', [1 20]);
lgraph = removeLayers(lgraph, 'pixelLabels');
lgraph = addLayers(lgraph, pxLayer);
lgraph = connectLayers(lgraph, 'softmax' ,'labels');
%%options specifications %%
trn_gnd_categ = categorical( trn_gnd,[0 1],{'b','c'});
net = trainNetwork(Itrn , trn_gnd_categ , lgraph, options)
But I get "Invalid training data. Y must be a vector of categorical responses. " error. I cant find where I'm wrong...

Answers (0)

Asked:

on 10 Feb 2018

Community Treasure Hunt

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

Start Hunting!