Error during training phase

14 ビュー (過去 30 日間)
paola
paola 2012 年 4 月 27 日
回答済み: Fan Chang Jiet 2022 年 5 月 13 日
Hallo! I have a code:
nndata=[nndata;testdata1];
nnlabels=[traininglabels; testinglabels];
inputs = nndata';
targets = nnlabels';
hiddenLayerSize = 25;
netx = patternnet(hiddenLayerSize);
netx.divideParam.trainRatio = 70/100;
netx.divideParam.valRatio = 15/100;
netx.divideParam.testRatio = 15/100;
netx.trainFcn='trainlm';
[netx,tr]=train(netx,inputs,targets);
I am getting the error as:
??? Undefined function or method 'eq' for input arguments of type 'network'.
Error in ==> C:\Programmi\MATLAB\R2011a\toolbox\prtools\@dataset\subsref.p>subsref at 23
Error in ==> automa at 169 net=train(netx,inputs,targets);
This code, with a different computer, runs with no errors. Can someone help me understand what may be the cause? can anyone help me find a solution? Thank you in advance.

採用された回答

Walter Roberson
Walter Roberson 2012 年 4 月 27 日
That could happen if for some reason it thought "train" was the name of a matrix, such as if the NN code was not installed (or the installation was corrupt.)
Try
which -all train
to see what that system thinks "train" is.

その他の回答 (5 件)

paola
paola 2012 年 4 月 27 日
thanks Walter.
MATLAB's response is:
which -all train
train is a variable.
C:\Programmi\MATLAB\R2011a\toolbox\nnet\nnet\@network\train.m % Shadowed network method
I think you're right...

louay saidi
louay saidi 2021 年 11 月 21 日
load trained.mat

louay saidi
louay saidi 2021 年 11 月 21 日
clear cam
load trainedmodel.mat
cam=webcam();
%cam = ipcam("http://192.168.1.10:8080/video");
while 1
I=cam.snapshot;
I = imresize(I,[224,224]);
[bboxes,scores] = detect(detector,I);
if isempty(bboxes)
imshow(I)
title('no Mask')
drawnow
p='No Mask kindly wear to protect yourself';
NET.addAssembly('System,Speech');
ss = System.Speech.Synthesis.SpeechSynthesizer;
ss.volume = 100;
%Speak(ss, caUserInput)
Speak(ss, p)
else
I = insertObjectAnnotation(I, 'rectangle',bboxes,scores);
imshow(I)
title("Mask Detected")
drawnow
p='you are wearing mask thanks';
NET.addAssembly('System.Speech');
ss = System.Speech.Synthesis.SpeechSynthesizer;
ss.volume = 100.
%Speak((ss, caUserInput)
Speak(ss, p)
end
end

louay saidi
louay saidi 2021 年 11 月 21 日
Error using load
Unable to read file 'trainedmodel.mat'. No such file or directory.

Fan Chang Jiet
Fan Chang Jiet 2022 年 5 月 13 日
load train.mat

カテゴリ

Help Center および 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