Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'sklearn.mixture' has no attribute 'GMM'

I am attempting to run the following Python project:

https://github.com/huanghe314/Text-Independent-Speaker-Indentification-System

It depends on sklearn.mixture.GMM, but fails to find that module despite the fact that I have sklearn installed. The error it gives is as follows:

Traceback (most recent call last):

File "C:/Users/User/PyCharmApp/Text-Independent-Speaker-Indentification-System-master/Code/main.py", line 85, in <module>
    p_weight[m] = training.Training_feature_Weight(Name[m] + '.wav')


File "C:\Users\User\PyCharmApp\Text-Independent-Speaker-Indentification-System-master\Code\training.py", line 24, in Training_feature_Weight
    Weight_training = Training_info.GMM_Model_Weight()
  File "C:\Users\User\PyCharmApp\Text-Independent-Speaker-Indentification-System-master\Code\GMM.py", line 31, in GMM_Model_Weight
    weight = mixture.GMM(n_components = self.M, min_covar = 0.01, n_init = 10).fit(self.features).weights_

I'm running Python 3.6.

like image 202
BER NA Avatar asked Mar 05 '23 21:03

BER NA


1 Answers

sklearn.mixture.GMM is no longer available in current versions of sklearn, as per the documentation:

Deprecated since version 0.18: This class will be removed in 0.20. Use sklearn.mixture.GaussianMixture instead.

Given that, I believe your options are either to change the code to use GaussianMixture or downgrade your version of sklearn.

like image 155
cody Avatar answered Mar 16 '23 21:03

cody