0

I am making a project ragrading to sign language recognition by Surface EMG signal. Now, I want to train a GMMHMM model by an array named 'single'. Its shape is (2520, 840).

for single in Norm_Feat_Vsplit:
    # print(shape(single))  # (180, 840)
    # print(type(single))  # <class 'numpy.ndarray'>
    clf = hmm.GMMHMM(n_components=7, n_mix=4, covariance_type="diag", n_iter=10)
    print('Training ' + str(index) + ' model... ')
    clf1 = clf.fit(single)
    print('Training finished!')
    # Save model
    print('Saving model...')
    joblib.dump(clf1, "Hmm_model" + str(index) + ".m")
    print('Saving finished!')

But there will be always a ValueError as following: (Sometimes it seems to be able to train the first GMMHMM model successfully, but the second will have an error.) output:

Training 1 model... 
Traceback (most recent call last):
  File "E:/桌面/手语识别资料/程序/Single_Hand/Single_Hand/One_Hand_Train(注释).py", line 378, in <module>
    main()
  File "E:/桌面/手语识别资料/程序/Single_Hand/Single_Hand/One_Hand_Train(注释).py", line 365, in main
    clf1 = clf.fit(single)
  File "D:\Anaconda3\lib\site-packages\hmmlearn\base.py", line 436, in fit
    bwdlattice)
  File "D:\Anaconda3\lib\site-packages\hmmlearn\hmm.py", line 607, in _accumulate_sufficient_statistics
    raise ValueError
ValueError

Process finished with exit code 1

Thank for your help!

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • I use a list, 'models', to restore the trained model, and then it is OK! But I still don't understand how it works. – Wang Chunpeng May 06 '18 at 14:25
  • Eyllanesc, thank you very much for making my question more clear! I'm not quite familiar with how to use this wed and ask questions in English... ... – Wang Chunpeng May 06 '18 at 14:31

0 Answers0