簡體   English   中英

類型錯誤:__init__() 得到了一個意外的關鍵字參數“n_iter”

[英]TypeError: __init__() got an unexpected keyword argument 'n_iter'

嘗試在 jupyter notebook 中運行代碼時出現錯誤

我試圖通過單獨安裝 python 來運行代碼,而不是使用任何 python IDE

TypeError                                 Traceback (most recent call last)
<ipython-input-6-b0fdfbdfd030> in <module>
    194 
    195 if __name__ == '__main__':
--> 196     add_user()

<ipython-input-6-b0fdfbdfd030> in add_user()
    182         # when features of 3 files of speaker are concatenated, then do model training
    183         if count == 3:
--> 184             gmm = GMM(n_components = 16, n_iter = 200, covariance_type='diag',n_init = 3)
    185             gmm.fit(features)
    186 

TypeError: __init__() got an unexpected keyword argument 'n_iter'

我需要得到錄音機的輸出

看起來您正在嘗試使用 SKLearn GMM對象,但可能會提供GausianMixture對象的參數,而 GMM 構造函數不支持這些參數。

n_iter參數以及n_init參數不是 GMM 對象的有效參數,因此我建議檢查每個參數的文檔(我為您鏈接了它們)並再次檢查您需要使用哪個,並相應地設置參數。

編輯:如果您嘗試使用的不是 SKLearn,請在關於您在此處使用哪個軟件包的問題中澄清這一點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM