필터 지우기
필터 지우기

LSTM-CNN "The size of the convolution dimension of the padded input data must be larger than or equal to the filter size"

조회 수: 36 (최근 30일)
Hello everyone,
I am trying to implement LSTM-CNN for speech recognition, I have a matrix for train and test which already are converted it to cell, when I excuted the code I got the error below:
net = trainNetwork(AllCellTrain, YCA, layers, options);
Caused by:
Layer 3: The size of the convolution dimension of the padded input data must be larger than or equal to the filter
size. For networks with sequence input, this check depends on the MinLength property of the sequence input layer. To
ensure that this check is accurate, set MinLength to the shortest sequence length of your training data.
The code that I have used:
% Define LSTM-CNN model architecture
numHiddenUnits = 100; % Number of hidden units in the LSTM layer
numFilters = 100; % Number of filters in the CNN layer
%filterSize = [3, 3]; % Size of the filters in the CNN layer
filterSize=3;
num_features = 39;
layers = [
sequenceInputLayer(num_features)
lstmLayer(numHiddenUnits,'OutputMode','sequence')
convolution1dLayer(filterSize, numFilters)
maxPooling2dLayer(2, 'Stride', 2)
fullyConnectedLayer(num_classes)
softmaxLayer
classificationLayer
];
% Specify the training options
max_epochs = 26;
mini_batch_size = 128;
initial_learning_rate = 0.001;
options = trainingOptions('adam', ...
'MaxEpochs', max_epochs, ...
'MiniBatchSize', mini_batch_size, ...
'InitialLearnRate', initial_learning_rate, ...
'GradientThreshold', 1, ...
'Shuffle', 'every-epoch', ...
'Verbose', 1, ...
'ExecutionEnvironment','auto', ...
'Plots', 'training-progress');
% Train the LSTM-CNN model
YCA = categorical(CA);
net = trainNetwork(AllCellTrain, YCA, layers, options);
Thanks in advance!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by