Sound-classification-on-Raspberry-Pi-with-Tensorflow icon indicating copy to clipboard operation
Sound-classification-on-Raspberry-Pi-with-Tensorflow copied to clipboard

I had an error on training in trainModel.py

Open wlsskgus0732 opened this issue 3 years ago • 1 comments

I had an error on this line train_x, test_x, train_y, test_y = train_test_split(features, labels, test_size=0.3, random_state=0)

they said ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.

How can I solve this?

wlsskgus0732 avatar Aug 18 '21 07:08 wlsskgus0732

Find this line of code:

mel = np.array(librosa.feature.melspectrogram(X, sr=sample_rate).T)

and replace with this line:

mel = np.array(librosa.feature.melspectrogram(y=X, sr=sample_rate).T)

Hope this helps.

sultanoid avatar Mar 14 '23 01:03 sultanoid