Error using == (line 30) Invalid types for comparison?

1 次查看(过去 30 天)
I am using builtin example of matlab on my dataset. when i run the test section it gives me error.
code:
fprintf('%s - Classifying test frames\n', datestr(toc/86400,'HH:MM:SS'))
% Gather the test frames into the memory
testFramesTall = tall(transform(testDSTrans, @helperModClassReadFrame));
rxTestFrames = gather(testFramesTall);
rxTestFrames = cat(4, rxTestFrames{:});
% Gather the test labels into the memory
testLabelsTall = tall(transform(testDSTrans, @helperModClassReadLabel));
rxTestLabels = gather(testLabelsTall);
rxTestPred = classify(trainedNet,rxTestFrames);
testAccuracy = mean(rxTestPred == rxTestLabels);
disp("Test accuracy: " + testAccuracy*100 + "%")

回答(1 个)

Walter Roberson
Walter Roberson 2021-4-21
rxTestLabels = categorical(gather(testLabelsTall));

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by