Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading and testing the model requires lb.fitTransform()? #15

Closed
BhargaviNadendla opened this issue Jan 8, 2019 · 7 comments
Closed

Comments

@BhargaviNadendla
Copy link

Hello,

I am trying to use your model to test the live audio recorded 'output10.wav'. I get the error for livepredictions = (lb.inverse_transform((liveabc))) as

This LabelEncoder instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.

Do I need to do lb.firTransform(y_train) and y_test before I just run your model?
Is there any other possibility to test the model before getting all the features from dataset?

Traceback (most recent call last):
File "C:\Users\BhargaviiNadendla\Documents\GitHub\Speech-Emotion-Analyzer\load.py", line 73, in
livepredictions = (lb.inverse_transform((liveabc)))
File "D:\Anaconda3\envs\Speech-Emotion-Analyzer\lib\site-packages\sklearn\preprocessing\label.py", line 272, in inverse_transform
check_is_fitted(self, 'classes_')
File "D:\Anaconda3\envs\Speech-Emotion-Analyzer\lib\site-packages\sklearn\utils\validation.py", line 951, in check_is_fitted
raise NotFittedError(msg % {'name': type(estimator).name})
sklearn.exceptions.NotFittedError: This LabelEncoder instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.

(Speech-Emotion-Analyzer) C:\Users\BhargaviiNadendla>sklearn.exceptions.NotFittedError: This LabelEncoder instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.
'sklearn.exceptions.NotFittedError:' is not recognized as an internal or external command,
operable program or batch file.

@MiteshPuthran
Copy link
Owner

No, you don't have to fit the model as its already been trained and you are just using it directly to predict the emotions.

Make sure you have imported LabelEncoder. It should not have given any error as many other people have used the model directly.

@BhargaviNadendla
Copy link
Author

Hi,

I have perfectly imported LabelEncoder() but the error is same, its asking to call 'fit' with appropriate arguments before using inverseTransform().

I am trying to train the model, but not clear about the datasets,
For RAVDESS, is it Audio_Speech_Actors_01-24.zip? Do we need to put all the files of ravdess and savee in rawdata/?
For SAVEE, the 4 actors DC, JE, JK, KL have the same named audio files in them, so not sure how to put all of them in one directory RawData.

Appreciate your help!

@MiteshPuthran
Copy link
Owner

Yes, you need to put all the files in the rawdata folder. For SAVEE you could put them in the same folder even though they have the same name. You will get filename and its multiple copies. Then you can go ahead and add labels respectively as I did in cell number 11.

@BhargaviNadendla
Copy link
Author

Thank you! That helped

@shyunju7
Copy link

Hi. we have the same problem...
How did you solve it?
I am looking forward to your reply!
Thank you:)

@mohammedsuhail85
Copy link

No, you don't have to fit the model as its already been trained and you are just using it directly to predict the emotions.

Make sure you have imported LabelEncoder. It should not have given any error as many other people have used the model directly.

I'm trying to use the pre-trained model. But getting the same error. I have imported the LabelEncoder successfully.
Any suggestions?

@mdsayem01k
Copy link

No, you don't have to fit the model as its already been trained and you are just using it directly to predict the emotions.
Make sure you have imported LabelEncoder. It should not have given any error as many other people have used the model directly.

I'm trying to use the pre-trained model. But getting the same error. I have imported the LabelEncoder successfully. Any suggestions?

I'm aslo getting same error when i was trying to use pre-trained model. Could you tell , how fixed the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants