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

조회 수: 2 (최근 30일)
Omar Bayomie
Omar Bayomie 2021년 7월 22일
편집: Omar Bayomie 2021년 7월 22일
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

답변 (0개)

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!