Error during training phase

14 visualizaciones (últimos 30 días)
paola
paola el 27 de Abr. de 2012
Respondida: Fan Chang Jiet el 13 de Mayo de 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.

Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de Abr. de 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.

Más respuestas (5)

paola
paola el 27 de Abr. de 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 el 21 de Nov. de 2021
load trained.mat

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

Fan Chang Jiet
Fan Chang Jiet el 13 de Mayo de 2022
load train.mat

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by