MiteshPuthran / Speech-Emotion-Analyzer

The neural network model is capable of detecting five different male/female emotions from audio speeches. (Deep Learning, NLP, Python)
MIT License
1.3k stars 438 forks source link

live demo #28

Closed Ataya95 closed 5 years ago

Ataya95 commented 5 years ago

Hello! im getting this error when im trying to run the live demo. can please help me with this. Thank you.


NameError Traceback (most recent call last)

in ----> 1 livepreds = loaded_model.predict(twodim, 2 batch_size=32, 3 verbose=1) NameError: name 'loaded_model' is not defined
torrentillo commented 5 years ago

ataya have you got the 70% accuracy with this model?

MiteshPuthran commented 5 years ago

Hello @Ataya95, you have not loaded the saved model before running this code. See cell no 137 where the model is loaded and then used in the live demo.

Ataya95 commented 5 years ago

Solved Thank you for replying! much appreciated.

Ataya95 commented 5 years ago

im getting this error as well can you help with this as well? thank you!


ValueError Traceback (most recent call last)

in ----> 1 cnnhistory=model.fit(x_traincnn, y_train, batch_size=16, epochs=700, validation_data=(x_testcnn, y_test)) F:\Installed Softwares\Anaconda\lib\site-packages\keras\engine\training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs) 950 sample_weight=sample_weight, 951 class_weight=class_weight, --> 952 batch_size=batch_size) 953 # Prepare validation data. 954 do_validation = False F:\Installed Softwares\Anaconda\lib\site-packages\keras\engine\training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, check_array_lengths, batch_size) 787 feed_output_shapes, 788 check_batch_axis=False, # Don't enforce the batch size. --> 789 exception_prefix='target') 790 791 # Generate sample-wise weight values given the `sample_weight` and F:\Installed Softwares\Anaconda\lib\site-packages\keras\engine\training_utils.py in standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix) 136 ': expected ' + names[i] + ' to have shape ' + 137 str(shape) + ' but got array with shape ' + --> 138 str(data_shape)) 139 return data 140 ValueError: Error when checking target: expected activation_20 to have shape (10,) but got array with shape (5,)
MiteshPuthran commented 5 years ago

@Ataya95 , No you don't need to download all the audio files. You just need to load the saved model and then just upload your audio file. It will automatically clip it to 4 seconds and those extracted features will be fed to the model to predict the emotions.

The error you are getting is related to the model building step where changed some parameter related to input size in the activation_20 layer.

Ataya95 commented 5 years ago

Thank you so much