unrecognized function or variable when working with pre-trained network?

what is the reason of that error and how can i fix it.
i loaded network (alexnet) , and exported layer to workspace in matlab but after runing the project, the layers_1 will disappear in workspace!!
thanks for your help.
here is the layers_1 i exported from DeepNetworkDesigner:
after i Run the project, the layers_1 will disappear:

5 件のコメント

Walter Roberson
Walter Roberson 2020 年 5 月 6 日
We need to see your code.
clear all; close all; clc;
net=alexnet
%analyzeNetwork(net)
imds = imageDatastore('lung augmented', ...
'IncludeSubfolders',true, ...
'LabelSource','foldernames');
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.7,'randomize',true);
augimdsTrain = augmentedImageDatastore([227 227],imdsTrain);
augimdsValidation = augmentedImageDatastore([227 227],imdsValidation);
options = trainingOptions('sgdm', ...
'MiniBatchSize',64, ...
'MaxEpochs',10, ...
'InitialLearnRate',0.0001, ...
'Shuffle','every-epoch', ...
'ValidationData',augimdsValidation, ...
'ValidationFrequency',3, ...
'Verbose',false, ...
'Plots','training-progress');
net = trainNetwork(augimdsTrain,layers_1,options)
[YPred, probs] = classify(net,augimdsValidation);
accuracy = mean(YPred ==imdsValidation.Labels)
figure
cm=confusionchart (imdsValidation.Labels, YPred);
shivan artosh
shivan artosh 2020 年 5 月 6 日
編集済み: shivan artosh 2020 年 5 月 6 日
excuse me what is this please:
i tried to export the alexnet layers.
I recommend getting rid of the line
clear all; close all; clc;
Walter Roberson
Walter Roberson 2020 年 5 月 7 日
Your code does not define layers_1 and does not load() it from anywhere. If you had it in your workspace before you ran the script, then it would have been destroyed by the "clear all"

サインインしてコメントする。

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 6 日
clear all
deletes all the variables loaded in workspace. It is also unrecommended to add this at top of every script. Remove it to avod deleting any varibles.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by