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.
0 个评论
采纳的回答
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.
0 个评论
更多回答(5 个)
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
0 个评论
louay saidi
2021-11-21
Error using load
Unable to read file 'trainedmodel.mat'. No such file or directory.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!