[英]AttributeError: module 'sklearn.mixture' has no attribute 'GMM'
I am attempting to run the following Python project: 我正在尝试运行以下Python项目:
https://github.com/huanghe314/Text-Independent-Speaker-Indentification-System 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. 这取决于
sklearn.mixture.GMM
,但未能找到该模块尽管我已经事实sklearn
安装。 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. 我正在运行Python 3.6。
sklearn.mixture.GMM
is no longer available in current versions of sklearn
, as per the documentation : sklearn.mixture.GMM
是在当前版本中不再sklearn
,按照该文件 :
Deprecated since version 0.18: This class will be removed in 0.20.
从版本0.18开始不推荐使用:此类将从0.20中移除。 Use
sklearn.mixture.GaussianMixture
instead.请改用
sklearn.mixture.GaussianMixture
。
Given that, I believe your options are either to change the code to use GaussianMixture
or downgrade your version of sklearn
. 鉴于此,我相信您的选择是更改代码以使用
GaussianMixture
或降级您的sklearn
版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.