Error during training phase

12 Ansichten (letzte 30 Tage)
paola
paola am 27 Apr. 2012
Beantwortet: Fan Chang Jiet am 13 Mai 2022
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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 27 Apr. 2012
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.

Weitere Antworten (5)

paola
paola am 27 Apr. 2012
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 am 21 Nov. 2021
load trained.mat

louay saidi
louay saidi am 21 Nov. 2021
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 am 21 Nov. 2021
Error using load
Unable to read file 'trainedmodel.mat'. No such file or directory.

Fan Chang Jiet
Fan Chang Jiet am 13 Mai 2022
load train.mat

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by