For a network with 1 inputs and 1 output, the datastore read function must return a cell array with 2 columns, but it returns an cell array with 1 columns.
7 views (last 30 days)
Show older comments
Gudimalla Pruthviraj
on 25 Jan 2022
Commented: Gudimalla Pruthviraj
on 27 Jan 2022
I Read all the audio files into AudioDatastore then Transformed to get MelSpectrograms
Now when I try to train my network with TransformedDatastore It giving the Below Error
"For a network with 1 inputs and 1 output, the datastore read function must return a cell array with 2 columns, but it
returns an cell array with 1 columns."
Thanks
0 Comments
Accepted Answer
jibrahim
on 25 Jan 2022
Hi Gudimalla,
The training process typically expects a pair from the datastore: For classification problems, it expects a mel spectrogram + the expected label or class. For regression problems, it expects two signals (two spectrograms, two sequences, two pairs of features, etc...representing input and desired output for example).
This example might be helpful:
Similar to your case, we use a transfomed datastore to extract spectrograms. However, notice that we combine the transformed datastore with another datastore that hold the labels:
adsSpecTrain = transform(adsAugTrain, @(x)getSpeechSpectrogram(x,afe,params));
Use an arrayDatastore to hold the training labels.
labelsTrain = arrayDatastore(adsTrain.Labels);
Create a combined datastore that points to the mel-frequency spectrogram data and the corresponding labels.
tdsTrain = combine(adsSpecTrain,labelsTrain);
tdsTrain is then passed to trainNetwork.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!