errors in training deep learning network from matlab help system examples

1 回表示 (過去 30 日間)
zuiyang shen
zuiyang shen 2019 年 11 月 20 日
回答済み: zuiyang shen 2019 年 11 月 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.

回答 (2 件)

Steven Lord
Steven Lord 2019 年 11 月 20 日
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 2019 年 11 月 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.

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by