x4nth055 / emotion-recognition-using-speech

Building and training Speech Emotion Recognizer that predicts human emotions using Python, Sci-kit learn and Keras
MIT License
585 stars 231 forks source link

Problem with GridSearch #28

Open zzirend opened 3 years ago

zzirend commented 3 years ago

Hello, Hope you are doing very well. I run the model in order to determine the best model (with GridSearch). But it runs with the following problem: 'GradientBoostingClassifier' object has no attribute 'presort'

I couldn't fix it. please help me. Thank you

x4nth055 commented 3 years ago

Hey @zzirend ,

What specific error is raised? in which file and line? Can you please send the traceback?

Thanks,

NeneMatsuki commented 2 years ago

Hi, I am getting the same problem, and here is the error message:

Traceback (most recent call last): File "C:\Users\nene.matsuki\Documents\GitHub\emotion-recognition-using-speech\grid_search.py", line 28, in d = EmotionRecognizer(model, emotions=emotions,model_name = f"grid/{model.class.name}", features = features) File "C:\Users\nene.matsuki\Documents\GitHub\emotion-recognition-using-speech\emotion_recognition.py", line 87, in init if not model: File "C:\Users\nene.matsuki\Anaconda3\envs\emotion_recognition_usingspeec\lib\site-packages\sklearn\ensemble_base.py", line 180, in len return len(self.estimators) AttributeError: 'GradientBoostingClassifier' object has no attribute 'estimators_'

Thanks :)

ruchirsachdeva commented 2 years ago

Hi @x4nth055 , I am getting the same problem as well

    if not model:
  File "/Users/ruchirs/ser/emotion-recognition-using-speech/emo-env/lib/python3.9/site-packages/sklearn/ensemble/_base.py", line 180, in __len__
    return len(self.estimators_)
AttributeError: 'RandomForestClassifier' object has no attribute 'estimators_'
x4nth055 commented 2 years ago

Hey @ruchirsachdeva and @NeneMatsuki,

I just tried to run the grid_search.py script and it worked fine, I think it's related to sklearn's version, please downgrade to 0.24.2 to be able to run the project properly:

$ pip install scikit-learn==0.24.2

Please let me know if it persists.

stardiviner commented 2 years ago

Hi @x4nth055 , I am getting the same problem as well

    if not model:
  File "/Users/ruchirs/ser/emotion-recognition-using-speech/emo-env/lib/python3.9/site-packages/sklearn/ensemble/_base.py", line 180, in __len__
    return len(self.estimators_)
AttributeError: 'RandomForestClassifier' object has no attribute 'estimators_'

I got same error.

@x4nth055 I tried this version scikit-learn. Still same problem.

fujiantaoshan commented 6 months ago

嗨,我也遇到了同样的问题

    if not model:
  File "/Users/ruchirs/ser/emotion-recognition-using-speech/emo-env/lib/python3.9/site-packages/sklearn/ensemble/_base.py", line 180, in __len__
    return len(self.estimators_)
AttributeError: 'RandomForestClassifier' object has no attribute 'estimators_'

我遇到了同样的错误。

我尝试了这个版本。还是同样的问题。scikit-learn

您好麻烦问一下您解决这个问题了吗