简体   繁体   中英

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

I am getting error while trying to run the code in jupyter notebook

I have tried to run the code by installing python separately, not using any 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'

I need to get the output of the voice recorder

It looks like you're trying to use an SKLearn GMM object, but possibly giving the parameters for a GausianMixture object instead, which arent supported in the GMM constructor.

The n_iter parameter, along with the n_init parameter are not valid parameters for the GMM object, so I would suggest checking the documentation for each (I linked them for you) and checking again which one you need to use, and setting the parameters accordingly.

EDIT: If its not SKLearn you're trying to use, please clarify this in your question regarding which package you're using here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM