Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
Faheem Ur Rehman
Faheem Ur Rehman am 21 Apr. 2021
Beantwortet: Walter Roberson am 21 Apr. 2021
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 + "%")

Antworten (1)

Walter Roberson
Walter Roberson am 21 Apr. 2021
rxTestLabels = categorical(gather(testLabelsTall));

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by