Menu

help on acoustic model

Help
lucy
2013-04-15
2016-05-26
  • lucy

    lucy - 2013-04-15

    when I was adapting the default acoustic model according to http://cmusphinx.sourceforge.net/wiki/tutorialadapt at the step of the "Accumulating observation counts" comes to a error:

    F:\pocketsphinx\model\hmm\zh>bw -hmmdir tdt_sc_8k -moddeffn tdt_sc_8k/mdef.txt -
    ts2cbfn .semi. -feat 1s_c_d_dd -svspec 0-12/13-25/26-38 -cmn current -agc none -
    dictfn arctic20.dic -ctlfn arctic20.fileids -lsnfn arctic20.transcription -accum
    dir .
    INFO: main.c(229): Compiled on Dec 13 2012 at 21:38:15
    INFO: cmd_ln.c(691): Parsing command line:
    bw \
    -hmmdir tdt_sc_8k \
    -moddeffn tdt_sc_8k/mdef.txt \
    -ts2cbfn .semi. \
    -feat 1s_c_d_dd \
    -svspec 0-12/13-25/26-38 \
    -cmn current \
    -agc none \
    -dictfn arctic20.dic \
    -ctlfn arctic20.fileids \
    -lsnfn arctic20.transcription \
    -accumdir .

    Current configuration:
    [NAME] [DEFLT] [VALUE]
    -2passvar no no
    -abeam 1e-100 1.000000e-100
    -accumdir .
    -agc none none
    -agcthresh 2.0 2.000000e+000
    -bbeam 1e-100 1.000000e-100
    -cb2mllrfn .1cls. .1cls.
    -cepdir
    -cepext mfc mfc
    -ceplen 13 13
    -ckptintv 0
    -cmn current current
    -cmninit 8.0 8.0
    -ctlfn arctic20.fileids
    -diagfull no no
    -dictfn arctic20.dic
    -example no no
    -fdictfn
    -feat 1s_c_d_dd 1s_c_d_dd
    -fullsuffixmatch no no
    -fullvar no no
    -help no no
    -hmmdir tdt_sc_8k
    -latdir
    -latext
    -lda
    -ldaaccum no no
    -ldadim 0 0
    -lsnfn arctic20.transcription
    -lw 11.5 1.150000e+001
    -maxuttlen 0 0
    -meanfn
    -meanreest yes yes
    -mixwfn
    -mixwreest yes yes
    -mllrmat
    -mmie no no
    -mmie_type rand rand
    -moddeffn tdt_sc_8k/mdef.txt
    -mwfloor 0.00001 1.000000e-005
    -npart 0
    -nskip 0
    -outphsegdir
    -outputfullpath no no
    -part 0
    -pdumpdir
    -phsegdir
    -phsegext phseg phseg
    -runlen -1 -1
    -sentdir
    -sentext sent sent
    -spthresh 0.0 0.000000e+000
    -svspec 0-12/13-25/26-38
    -timing yes yes
    -tmatfn
    -tmatreest yes yes
    -topn 4 4
    -tpfloor 0.0001 1.000000e-004
    -ts2cbfn .semi.
    -varfloor 0.00001 1.000000e-005
    -varfn
    -varnorm no no
    -varreest yes yes
    -viterbi no no

    INFO: feat.c(713): Initializing feature stream to type: '1s_c_d_dd', ceplen=13,
    CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(142): mean[0]= 12.00, mean[1..12]= 0.0
    INFO: main.c(254): Using subvector specification 0-12/13-25/26-38
    INFO: main.c(318): Reading tdt_sc_8k/mdef.txt
    INFO: model_def_io.c(573): Model definition info:
    INFO: model_def_io.c(574): 65091 total models defined (70 base, 65021 tri)
    INFO: model_def_io.c(575): 260364 total states
    INFO: model_def_io.c(576): 8210 total tied states
    INFO: model_def_io.c(577): 210 total tied CI states
    INFO: model_def_io.c(578): 70 total tied transition matrices
    INFO: model_def_io.c(579): 4 max state/model
    INFO: model_def_io.c(580): 4 min state/model
    ERROR: "s3io.c", line 612: Unable to read complete dataFATAL_ERROR: "main.c", li
    ne 1857: initialization failed

    please help me ! what should I do ?

     
  • Brian

    Brian - 2013-04-15

    Hi Lucy,

    I was able to successfully run the instructions in http://cmusphinx.sourceforge.net/wiki/tutorialadapt with the following bw command.

    I used a different base acoustic model than you. I found this model in svn at pocketsphinx-extra\model\hmm\en_US\hub4_wsj_sc_3s_8k.cd_semi_5000. When I tried the bw command using the suggested model (pocketsphinx-0.8-win32\model\hmm\en_US\hub4wsj_sc_8k), I ran into problems.

    bw -hmmdir ..\hub4_wsj_sc_3s_8k.cd_semi_5000 -moddeffn ..\hub4_wsj_sc_3s_8k.cd_semi_5000\mdef.txt -ts2cbfn .semi. -feat 1s_c_d_dd -svspec 0-12/13-25/26-38 -cmn current -agc none -dictfn arctic20.dic -ctlfn arctic20.fileids -lsnfn arctic20.transcription -accumdir .

    Hope this helps

     

    Last edit: Brian 2013-04-15
  • Nickolay V. Shmyrev

    Brian is 100% correct, for some reason you are using tdt_sc_8k model which is not the matching the mixture_weights file you downloaded. You either should use hub4wsj_sc_8k model for US English or download a proper mixture_weights file for tdt_model

     
    • lucy

      lucy - 2013-04-16

      When I change mixture_weights to zh_broadcastnews_ptm256_8000\mixture_weights,I get another error:
      INFO: s3mixw_io.c(116): Read tdt_sc_8k/mixture_weights [8210x4x256 array]
      FATAL_ERROR: "mod_inv.c", line 357: Number of feature streams in mixture_weights
      file 4 differs from the configured value 3, check the command line options
      (I use pocketsphinx-0.8-win32\model\hmm\zh\tdt_sc_8k at win7 <32bit>)

       
      • Nickolay V. Shmyrev

        The mixture weights file for your model tdt_sc_8k is in subversion:

        pocketsphinx-extra/model/hmm/zh/mandarin_sc3_notone_3s_8k.cd_semi_5000
        

        Please checkout the proper mixture weights file. zh_broadcastnews_ptm256 is a totally different model.

         
        • lucy

          lucy - 2013-04-16

          OhOh,I find this file .thank you
          but it still not work well.
          when screen comes:
          INFO: main.c(671): If you are not interested in profiling, use -timing no
          column defns
          <seq>
          <id>
          <n_frame_in>
          <n_frame_del>
          <n_state_shmm>
          <avg_states_alpha>
          <avg_states_beta>
          <avg_states_reest>
          <avg_posterior_prune>
          <frame_log_lik>
          <utt_log_lik>
          ... timing info ...
          utt> 0 arctic_0001 585INFO: cmn.c(175): CMN: 3.21 -0.81 -0.2
          5 0.12 -0.07 -0.04 -0.07 -0.11 -0.01 -0.01 -0.04 0.03 -0.06
          0 40</utt_log_lik></frame_log_lik></avg_posterior_prune></avg_states_reest></avg_states_beta></avg_states_alpha></n_state_shmm></n_frame_del></n_frame_in></id></seq>

          bw.exe stop working .I don't know where has the problem.

           
        • Toxa

          Toxa - 2014-10-05

          Hi, could you help me, I try to make adaptation from acoustic model for recognition with sphinx 4 in continue regime with sample rate 16kHz (not for pocketsphinx as I understand) WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz, which is in sphinx4-5prealpha-src package and with my bad pronunciation needed adaptation.

          Here is my command, which I run from shell (Ubuntu 14.04, 64-bit, sphinxtrain compiled with gcc 4.8 version).

          ./bw -hmmdir ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz -moddeffn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/mdef.txt -feat 1s_c_d_dd -ts2cbfn .semi. -svspec 0-12/13-25/26-38 -cmn current -agc none -dictfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.dic -ctlfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.fileids -lsnfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.transcription -accumdir ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/

          Here is result of this command:

          INFO: main.c(229): Compiled on Oct 3 2014 at 21:40:38
          INFO: cmd_ln.c(691): Parsing command line:
          /home/tank/sphinx/sphinxtrain/src/programs/bw/.libs/lt-bw \
          -hmmdir ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz \
          -moddeffn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/mdef.txt \
          -feat 1s_c_d_dd \
          -ts2cbfn .semi. \
          -svspec 0-12/13-25/26-38 \
          -cmn current \
          -agc none \
          -dictfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.dic \
          -ctlfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.fileids \
          -lsnfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.transcription \
          -accumdir ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/

          Current configuration:
          [NAME] [DEFLT] [VALUE]
          -2passvar no no
          -abeam 1e-100 1.000000e-100
          -accumdir ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/
          -agc none none
          -agcthresh 2.0 2.000000e+00
          -bbeam 1e-100 1.000000e-100
          -cb2mllrfn .1cls. .1cls.
          -cepdir
          -cepext mfc mfc
          -ceplen 13 13
          -ckptintv 0
          -cmn current current
          -cmninit 8.0 8.0
          -ctlfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.fileids
          -diagfull no no
          -dictfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.dic
          -example no no
          -fdictfn
          -feat 1s_c_d_dd 1s_c_d_dd
          -fullsuffixmatch no no
          -fullvar no no
          -help no no
          -hmmdir ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz
          -latdir
          -latext
          -lda
          -ldaaccum no no
          -ldadim 0 0
          -lsnfn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/arctic20.transcription
          -lw 11.5 1.150000e+01
          -maxuttlen 0 0
          -meanfn
          -meanreest yes yes
          -mixwfn
          -mixwreest yes yes
          -mllrmat
          -mmie no no
          -mmie_type rand rand
          -moddeffn ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/mdef.txt
          -mwfloor 0.00001 1.000000e-05
          -npart 0
          -nskip 0
          -outphsegdir
          -outputfullpath no no
          -part 0
          -pdumpdir
          -phsegdir
          -phsegext phseg phseg
          -runlen -1 -1
          -sentdir
          -sentext sent sent
          -spthresh 0.0 0.000000e+00
          -svspec 0-12/13-25/26-38
          -timing yes yes
          -tmatfn
          -tmatreest yes yes
          -topn 4 4
          -tpfloor 0.0001 1.000000e-04
          -ts2cbfn .semi.
          -varfloor 0.00001 1.000000e-05
          -varfn
          -varnorm no no
          -varreest yes yes
          -viterbi no no

          INFO: feat.c(713): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
          INFO: cmn.c(142): mean[0]= 12.00, mean[1..12]= 0.0
          INFO: main.c(254): Using subvector specification 0-12/13-25/26-38
          INFO: main.c(318): Reading ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/mdef.txt
          INFO: model_def_io.c(573): Model definition info:
          INFO: model_def_io.c(574): 110878 total models defined (49 base, 110829 tri)
          INFO: model_def_io.c(575): 443512 total states
          INFO: model_def_io.c(576): 4147 total tied states
          INFO: model_def_io.c(577): 147 total tied CI states
          INFO: model_def_io.c(578): 49 total tied transition matrices
          INFO: model_def_io.c(579): 4 max state/model
          INFO: model_def_io.c(580): 4 min state/model
          INFO: s3mixw_io.c(116): Read ./WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/mixture_weights [4147x1x8 array]
          FATAL_ERROR: "mod_inv.c", line 357: Number of feature streams in mixture_weights file 1 differs from the configured value 3, check the command line options

          Unfortunately I don't understand which of argument is wrong, because I swapped them and it always says that "value 3" is wrong.

          What can I do with this mixture_weights and how can I adapt this or any one else model by this tutorial http://cmusphinx.sourceforge.net/wiki/tutorialadapt?

          Will be thankful for any help. Thanks.

           
          • Nickolay V. Shmyrev

            According to the tutorial instead of

             -ts2cbfn .semi. -svspec 0-12/13-25/26-38
            

            You need to use just

             -ts2cbfn .cont.
            
             
            • Toxa

              Toxa - 2014-10-06

              Thank you very much.

               
      • Jiantao

        Jiantao - 2016-05-25

        Hi, Lucy, I have meet the same problem with you, could you help me with the problem: "FATAL_ERROR: "mod_inv.c", line 357: Number of feature streams in mixture_weights" ? Really appreciate your help.

         

        Last edit: Jiantao 2016-05-26
        • Nickolay V. Shmyrev

          Lucy were here a year ago. If you need help you can provide more details on what you are doing, what error do you see and so on. This particular error means you did not provide a correct arguments to bw exectuable.

           
  • Nickolay V. Shmyrev

    Probably there are some other issues. Please provide the files in your adaptation folder for analysis

    Please let us know which CMUSphinx version are you using.

     
    • lucy

      lucy - 2013-04-16

      After I change some files, it can work well.thank you !

       
  • Ming Chen

    Ming Chen - 2014-08-16

    Hi,

    I'm getting the same error message.
    I use hub4wsj_sc_8k and it worked well for pocketsphinx_continuous. But when I try to adapt it to my recordings in sphinxtrain-1.0.8-win32. I get the following error.

    Number of feature streams in mixture_weights file 3 differs from the configured value 1

    I would like to know in which part does this mismatch happens. Or, which two files are the program comparing? How can I deal with that?

    Also, when I adapt to en-us, I get the error Failed to read MFC file. I have checked that those files are generated in the previous step in my batch command.

    %bin_dir%\sphinx_fe ^
    -argfile adapt\%adapt_am%\feat.params ^
    -samprate 16000 ^
    -c adapt\%adapt_wavids% ^
    -di adapt\%adapt_wav% ^
    -do adapt\%adapt_wav% ^
    -ei wav ^
    -eo mfc ^
    -mswav yes

    Where exactly is the program searching for those MFC files?

    Thanks!

     
  • Nickolay V. Shmyrev

    I would like to know in which part does this mismatch happens. Or, which two files are the program comparing? How can I deal with that?

    The number of streams is configured with -svspec option to bw which you probably missed from the command line.

    Where exactly is the program searching for those MFC files?

    In the current folder or in some other folder if you specified it with -cepdir
    option to bw.

     
    • Ming Chen

      Ming Chen - 2014-08-17

      Thanks! -cepdir solves the missing .mfc issues. For mismatch, I was messing up with continuous and semi-continuous models. For continuous model, -svspec should not be included, but for semi-continuous it should be included.

      After map_adapt, some of the model files e.g. mdef, noisedict, feat.params and feature_transform are missing in the folder. Shall I copy those files from the original model to the adapted model?

       
      • Nickolay V. Shmyrev

        After map_adapt, some of the model files e.g. mdef, noisedict, feat.params and feature_transform are missing in the folder. Shall I copy those files from the original model to the adapted model?

        You can copy missing files. feature_transform file is not used by semi-continuous models like hub4wsj_sc_8k. You should not copy it.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.