using datastore with trainNetwork

5 ビュー (過去 30 日間)
Noam
Noam 2023 年 2 月 7 日
コメント済み: Noam 2023 年 2 月 7 日
I'm trying to train mp3/wav files using yamnet, I've created an audioDataStore which load the files, then I transform it to get data that suits to Yamnet, and then I try to train it. I get the folowing error:
Invalid training data. Predictors must be a numeric array, a datastore, or a table. For networks with
sequence input, predictors can also be a cell array of sequences.
Can't I use transformedDataStore with trainNetwork?
This is my code:
net = yamnet;
DS = audioDatastore(FolderName, ...
'FileExtensions',{'.wav','.mp3'},"IncludeSubfolders",true,'LabelSource','foldernames');
TR = transform(DS,@(audio,info)preProcess(audio,info),"IncludeInfo",true);
options = trainingOptions("adam");
trainNetwork(net,TR,options)
function [data,info] = preProcess(audio,info)
data = yamnetPreprocess(audio,info.SampleRate);
end
Thanks

採用された回答

Aylin
Aylin 2023 年 2 月 7 日
編集済み: Aylin 2023 年 2 月 7 日
Hello Noam, maybe the trainNetwork inputs are in the wrong order? The datastore should be first, followed by the layers and the options. Does this work better?
trainNetwork(TR,net,options)
Rylan
  2 件のコメント
Noam
Noam 2023 年 2 月 7 日
my bad, actually chaniging to:
trainNetwork(TR,net.Layers,options) do the work.
Thanks!
Noam
Noam 2023 年 2 月 7 日
i added a following question:
https://www.mathworks.com/matlabcentral/answers/1908330-input-datastore-returned-more-than-one-observation-per-row-for-network-input-1

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePretrained Models についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by