MATLAB Answers

0

errors in training deep learning network from matlab help system examples

Asked by zuiyang shen on 20 Nov 2019 at 6:14
Latest activity Answered by zuiyang shen on 22 Nov 2019 at 5:22
I am try training deep learning network, but the example from matlab help system can not work
clc,clear
[XTrain,YTrain] = japaneseVowelsTrainData;
figure
plot(XTrain{1}')
title("Training Observation 1")
numFeatures = size(XTrain{1},1);
legend("Feature " + string(1:numFeatures),'Location','northeastoutside')
inputSize = 12;
numHiddenUnits = 100;
numClasses = 9;
layers = [ ...
sequenceInputLayer(inputSize)
lstmLayer(numHiddenUnits,'OutputMode','last')
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer]
maxEpochs = 100;
miniBatchSize = 27;
options = trainingOptions('adam', ...
'ExecutionEnvironment','cpu', ...
'MaxEpochs',maxEpochs, ...
'MiniBatchSize',miniBatchSize, ...
'GradientThreshold',1, ...
'Verbose',false, ...
'Plots','training-progress');
net = trainNetwork(XTrain,YTrain,layers,options);
matlab give the following results:
Error using trainNetwork (line 170)
Too many input arguments.

  0 Comments

Sign in to comment.

2 Answers

Answer by Steven Lord
on 20 Nov 2019 at 16:13

Which release of Deep Learning Toolbox or Neural Network Toolbox are you using?
How does this example appear (or does it appear?) in the documentation included in your installation? Does it call trainNetwork with four inputs as you do in this code? Does trainNetwork list a syntax that accepts four inputs on its documentation page?
Remember that the online documentation is for the most recent release (currently release R2019b) and if you're using an older release you may not have access to all the functionality the examples use. This is especially likely if the examples were introduced in a later release.

  0 Comments

Sign in to comment.


Answer by zuiyang shen on 22 Nov 2019 at 5:22

thank you!
The release of deep learning toolbox from matlab I used is 2019b ,a trial software.
the results from the demo is:
Error using trainNetwork (line 170)
Too many input arguments.
Error in cc_3 (line 12)
net = trainNetwork(XTrain, YTrain, layers, options);
Caused by:
Error using xlim
Too many input arguments.

  0 Comments

Sign in to comment.