- Verify that the inputs to the trainnetwork function are passed in the required format, i.e format for sequences and format for responses.
- Ensure that the input data XTrain matches the dimensions specified in sequenceInputLayer, i.e. n_samples-by-numFeatures.
- Ensure that the filterSize and numFilters are appropriate for the data.
- Ensure that the sequencePaddingDirection has been set correctly.
Array inputs have incompatible channel dimensions.
3 ビュー (過去 30 日間)
古いコメントを表示
im error using trainNetwork. i have no idea, im newbie here. im using matlab 2022a
layers = [ ...
sequenceInputLayer([n_samples,numFeatures])
convolution1dLayer(filterSize,numFilters,'Padding','same')
eluLayer
maxPooling1dLayer(3, 'Stride', 2)
flattenLayer
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer];
miniBatchSize = 50;
options = trainingOptions("adam", ...
MiniBatchSize=miniBatchSize, ...
MaxEpochs=10, ...
L2Regularization=0.00005,...
Shuffle='every-epoch',...
ValidationFrequency=10,...
ValidationPatience=20,...% for early stop
SequencePaddingDirection="left", ...
ValidationData={XValidation,TValidation}, ...
Plots='none', ...% or "training-progress" , 'none'
Verbose=1);
net = trainNetwork(XTrain,TTrain,layers,options);
0 件のコメント
回答 (1 件)
Govind KM
2024 年 10 月 17 日
Hi Ahmad,
A common reason for the mentioned error is a mismatch between the dimensions of input data and the expected input dimensions specified by the network. Here are potential steps to debug the issue:
A related MATLAB Answers post about the same error mentions that the issue is fixed in R2024a:
If the issue still persists, providing the data used would help in debugging the issue further.
Hope this is helpful!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!