Can't get the gradient attribution map to work from "Explore Network Predictions Using Deep Learning Visualization Techniques" page on Mathworks
1 view (last 30 days)
Show older comments
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");
1 Comment
Answers (0)
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!