crhung/Voice-Emotion-Detector

Question for part <Testing out with live voices>

songo427 opened this issue · 0 comments

Hi, I'd like to test Voice-Emotion-Detector model using output10.wav.
So, I wrote the following code.
`
import numpy as np
from scipy.io.wavfile import read
from keras.models import load_model

test_voice = read("output10.wav")

livedf2 = np.array(test_voice[1], dtype=float)

twodim = np.expand_dims(livedf2, axis=2)

loaded_model = load_model("saved_models\Emotion_Voice_Detection_Model.h5")

livepreds = loaded_model.predict(twodim, batch_size=32, verbose=1)
`

And the following error has occurred:
ValueError: Error when checking input: expected conv1d_7_input to have shape (216, 1) but got array with shape (2, 1)

Is it correct the code I wrote to test Voice-Emotion-Detector model?

I tried reshape() to resolve the error that the shape of array didn't match, but it didn't work.
Is there any other way? If there is, let me know please!

Thank you :)