问题:
kaldi在训练语言模型时出现以下错误:
Not creating raw N-gram counts ngrams.gz and heldout_ngrams.gz since they already exist in data/local/lm/3gram-mincount
(remove them if you want them regenerated)
Iteration 1/6 of optimizing discounting parameters
discount_ngrams: for n-gram order 1, D=0.600000, tau=0.675000 phi=2.000000
discount_ngrams: for n-gram order 2, D=0.800000, tau=0.675000 phi=2.000000
discount_ngrams: for n-gram order 3, D=0.000000, tau=0.825000 phi=2.000000
discount_ngrams: for n-gram order 1, D=0.600000, tau=0.900000 phi=2.000000
discount_ngrams: for n-gram order 2, D=0.800000, tau=0.900000 phi=2.000000
discount_ngrams: for n-gram order 3, D=0.000000, tau=1.100000 phi=2.000000
interpolate_ngrams: 51177 words in wordslist
Perplexity over 0.000000 words is -nan
Perplexity over 0.000000 words (excluding 0.000000 OOVs) is -nan
real 0m0.049s
user 0m0.020s
sys 0m0.076s
interpolate_ngrams: 51177 words in wordslist
Perplexity over 0.000000 words is -nan
Perplexity over 0.000000 words (excluding 0.000000 OOVs) is -nan
real 0m0.028s
user 0m0.020s
sys 0m0.060s
discount_ngrams: for n-gram order 1, D=0.600000, tau=1.215000 phi=2.000000
discount_ngrams: for n-gram order 2, D=0.800000, tau=1.215000 phi=2.000000
discount_ngrams: for n-gram order 3, D=0.000000, tau=1.485000 phi=2.000000
interpolate_ngrams: 51177 words in wordslist
Perplexity over 0.000000 words is -nan
Perplexity over 0.000000 words (excluding 0.000000 OOVs) is -nan
real 0m0.028s
user 0m0.016s
sys 0m0.052s
Bad perplexities . at /home/work/kaldi/tools/kaldi_lm/optimize_alpha.pl line 30.
解决方法:
如果确定前面所有步骤没有错误,则将data/local/lm删掉,并重新进行训练即可解决。
注:博主遇到前面有一个地方错误,导致生成时候缺少文件,因此将data/local/lm删掉并没有解决问题。因此先浏览日志文件,仔细查看前面是否有错误。