user79500
user79500

Reputation: 31

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

Upvotes: 3

Views: 5004

Answers (1)

Farrago-Alex
Farrago-Alex

Reputation: 120

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.

Upvotes: 2

Related Questions