Can't get the gradient attribution map to work from "Explore Network Predictions Using Deep Learning Visualization Techniques" page on Mathworks

I am using a custom trained AlexNet which has a softmaxname called "prob" but get the following error message:
Error using nnet.internal.cnn.dlnetwork>iAssertLayerNameExist
Layer 'prob' does not exist.
Error in nnet.internal.cnn.dlnetwork>iGetOutputIndices (line 497)
iAssertLayerNameExist(layerName, map);
Error in nnet.internal.cnn.dlnetwork/getOutputLayersIndicesFromNames (line 292)
[outputLayerIdx(i), outputLayerPortIdx(i)] = iGetOutputIndices(outputNames(i), layerNameMap, layers);
Error in dlnetwork/getOutputLayersIndices (line 1228)
[layerIndices, layerOutputIndices] = getOutputLayersIndicesFromNames(net.PrivateNetwork, string(outputNames));
Error in dlnetwork/predict (line 859)
[layerIndices, layerOutputIndices] = getOutputLayersIndices(net, NameValueArgs);
Error in gradientMap (line 7)
scores = predict(dlnet,I,'Outputs',{softmaxName});
Error in deep.internal.dlfeval (line 17)
[varargout{1:nargout}] = fun(x{:});
Error in dlfeval (line 40)
[varargout{1:nargout}] = deep.internal.dlfeval(fun,varargin{:});
Error in gradientAttribution (line 15)
dydI = dlfeval(@gradientMap,dlnet,dlImg,softmaxName,YPred);
Error in untitled14 (line 48)
pixelMap = gradientAttribution(netTransfergrey10dB,img,YPred,softmaxName,"autodiff");

답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

ps
2023년 2월 16일

댓글:

2023년 2월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by