属性错误:模块'sklearn.mixture'没有属性'GMM'。

4
我尝试运行以下Python项目:https://github.com/huanghe314/Text-Independent-Speaker-Indentification-System。它依赖于sklearn.mixture.GMM,但是尽管我已经安装了sklearn,它仍然无法找到该模块。它给出的错误如下:
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_

我正在运行 Python 3.6。


2
嗨,请展示一些你的Python代码。 - Stefan
2
然后,请将其作为问题的[编辑]发布。 - Stefan
1个回答

8

sklearn.mixture.GMM在当前版本的sklearn中已不再提供,根据文档

自版本0.18起,此类已弃用:将在0.20中删除。请改用sklearn.mixture.GaussianMixture

因此,您的选择是要么更改代码以使用GaussianMixture,要么降级您的sklearn版本。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接