python - AttributeError:模块“sklearn.mixture”没有属性“GMM”
问题描述
我正在尝试运行以下 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。
解决方案
sklearn.mixture.GMM
sklearn
根据文档,在当前版本中不再可用:
自 0.18 版后已弃用:此类将在 0.20 中删除。改为使用
sklearn.mixture.GaussianMixture
。
鉴于此,我相信您的选择是更改代码以使用GaussianMixture
或降级您的sklearn
.
推荐阅读
- python - (custom user) createsuperuser TypeError: hasattr(): attribute name must be string
- reactjs - 从 json 响应迭代内部数组
- r - 问题:在 openSUSE Leap 15.0 上安装 R:“需要 liblzma 库和头文件”
- jquery - 在jquery上方加载旧评论后将固定评论重新定位在顶部
- android - Can't see elements layout android studio in activity_main.xml
- git - 保留来自不同分支的文件变体的本地版本
- java - Printing Vertical Histogram to console
- javascript - 使用 onchange 方法的 Javascript 未捕获的 ReferenceError
- regex - Regex: Extract content between two strings using sed over multiple lines
- java - jsoup - 如何选择特定 h3 之后段落中的所有链接(也有 id 和 span 类)