AttributeError:模块'sklearn.混合物'没有属性'GMM'

2024-09-28 17:05:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试运行以下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_

我运行的是python3.6。在


Tags: textpymasterlinecodesystemusersfile
1条回答
网友
1楼 · 发布于 2024-09-28 17:05:53

sklearn.mixture.GMM在当前版本的sklearn中不再可用,根据documentation

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

鉴于此,我相信您的选择要么是更改代码以使用GaussianMixture,要么是降低{}的版本。在

相关问题 更多 >