errors in training deep learning network from matlab help system examples

2 views (last 30 days)
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.

Answers (2)

Steven Lord
Steven Lord on 20 Nov 2019
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.

zuiyang shen
zuiyang shen on 22 Nov 2019
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.

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!