F612
F612

Reputation: 566

Using matlab example for regression

I am trying to learn DL with an example. However, running the following code results in an error

imds = imageDatastore(fullfile(rootFolder),'Labels',lab.labels35_16);
imds.ReadFcn = @(filename)readAndPreprocessImage(filename);    
[trainingSet, testSet] = splitEachLabel(imds, 0.3, 'randomize');
trainingFeatures = activations(convnet, trainingSet, featureLayer, ...
    'MiniBatchSize', 32, 'OutputAs', 'columns');

sAnd the error is Undefined function 'categories' for input arguments of type 'double'. I understand that categories in he original example is string based labels. But mine is int values. Not sure why it isn't working. Kindly helpError follow up

Upvotes: 0

Views: 325

Answers (1)

AGD
AGD

Reputation: 34

From the documentation of catogories, it seems like the input needs to be a categorical. You might have to do categories(categorical()).

Upvotes: 1

Related Questions