Error during training phase

14 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by