0

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

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Please do not post link-only answers, but rather copy relevant excerpts to the page. If either page is moved or deleted, the links and answer are of little use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.