Class Activation Map, Classify requires at least 3 arguments for (.h5 CNN model)

2 views (last 30 days)
I have an error related to classify function ;
I tried to read its documentation, Do you think the problem with our model has no categorical classes for the group argument? or matlab invokes stat classify instead of DL classify?
It works fine with other nets like googlenet .
net = importKerasLayers("best_model.h5", 'ImportWeights', true);
img = imread("normal.PNG");
img = rgb2gray(img);
img = imresize(img, [240,120]);
[classfn,score] = classify(net,img);
imshow(img);
title(sprintf("%s (%.2f)", classfn, score(classfn)));
map = gradCAM(net,img,classfn);
imshow(img);
hold on;
imagesc(map,'AlphaData',0.5);
colormap jet
hold off;
title("Grad-CAM");
Error using classify (line 123)
Requires at least three arguments.
Error in CAMtrial (line 9)
[classfn,score] = classify(net,img);
Thanks ;
Omar

Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!