Error Using trainNetwork (line 170). Too many input arguments.

조회 수: 22 (최근 30일)
syed
syed 2021년 2월 11일
댓글: syed 2021년 2월 17일
Where did i go wrong? Please help me with the code.
I have a table of 500x31 (features as columns =30 and class lable column 31 ). Feature values are in rows for 5 class (100 rows for each class).
dataset sample is shown below. when i run the code i am getting error
"Error using trainNetwork (line 170)
Too many input arguments.
Error in calling1 (line 30)
net = trainNetwork(dataTrain,YTrain,layers_1,options);
Caused by:
Error using trainNetwork>iParseInputArguments (line 326)
Too many input arguments."
%Spliting the data set into 80:20
cvp=cvpartition(coif2level3.class,'holdout',0.2);
dataTrain=coif2level3(training(cvp),:);
dataValidation=coif2level3(test(cvp),:);
XTrain=dataTrain(:,1:30);
YTrain=dataTrain.class;
YValidation=dataValidation.class;
%XTrain size 400x30
%YTrain size 400X1
%workspace
% Defining LSTM Architecture
numFeatures = 30;
numHiddenUnits = 100;
numClasses = 5;
layers_1= [ ...
sequenceInputLayer(numFeatures)
lstmLayer(numHiddenUnits,'OutputMode','last')
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer];
miniBatchSize = 27;
maxEpochs = 100;
options = trainingOptions('adam', ...
'ExecutionEnvironment','cpu', ...
'MaxEpochs', ...
'MiniBatchSize',miniBatchSize, ...
'GradientThreshold',2, ...
'Shuffle','every-epoch', ...
'Verbose',false, ...
'Plots','training-progress');
net = trainNetwork(dataTrain,YTrain,layers_1,options);

채택된 답변

Christopher McCausland
Christopher McCausland 2021년 2월 11일
편집: Christopher McCausland 2021년 2월 11일
"Too many input arguments" is a sign that the function expects fewer input arguments. In this case your input arguments appear to be=> dataTrain,YTrain,layers_1,options.
Are only the arguments included in your function call? I think you may have included an extra one, or more.
[Returned_Argument] = myfunc(dataTrain,YTrain,layers_1,options);
  댓글 수: 5
Walter Roberson
Walter Roberson 2021년 2월 17일
introduced in R2020b

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by