初跑timit数据

  1. 把压缩包解压到对应的文件夹~/kaldi/egs/timit/s5/data

  2. 首先我们需要修改数据集的目录:

#timit=/export/corpora5/LDC/LDC93S1/timit/TIMIT # @JHU
#timit=/mnt/matylda2/data/TIMIT/timit # @BUT
# 上面两行是代码中原有的数据集位置,我们需要执行定制为下面的路径:
timit=/home/yangqing/kaldi/egs/timit/s5/data/TIMIT

接下来 运行sudo ./run.sh

我出现了错误如下:

local/timit_prepare_dict.sh: Error: the IRSTLM is not available or compiled
local/timit_prepare_dict.sh: Error: We used to install it by default, but.
local/timit_prepare_dict.sh: Error: this is no longer the case.
local/timit_prepare_dict.sh: Error: To install it, go to /home/yangqing/kaldi/egs/timit/s5/../../../tools
local/timit_prepare_dict.sh: Error: and run extras/install_irstlm.sh

于是在网上找到三个解决方法针对不同的问题 

1)“awk:line12:function gensub never defined” 
解决: sudo apt-get install gawk

2)“Error: and run extras/install_irstlm.sh” 
解决:因为这个例程建立语言模型是用irstlm工具建立的,但是在最新版本的kaldi里面,irstlm不是默认编译的。首先进入kaldi目录下的tools/extras目录,执行install_irstlm.sh脚本。安装完成以后,目录下出现irstlim目录。由于timit例程里面的引用irstlm工具的路径是tools目录,所以把这个目录拷贝到tools/目录下。回到egs/timit/s5目录,执行./run.sh脚本,于是timit例程就跑起来了。

3)“Error: the IRSTLM is not available or compiled” 
解决:cd kaldi-master/tools/extras 
./install_irstlm.sh 
将生成的env.sh复制到tools文件夹下即可。

我用的是第三种方法,搞定

但是又出现也第二个错误:

扫描二维码关注公众号,回复: 3372976 查看本文章
error: qsub not found.

这是因为 TIMIT 的这个例子部署在多机器上,我们想要在本地运行所有的任务,需要修改 cmd.sh 中的内容:

# no GridEngine
export train_cmd=run.pl
export decode_cmd=run.pl
export cuda_cmd=run.pl
export mkgraph_cmd=run.pl

# 下面的内容均为多机器任务的命令,依赖 Sun GridEngine,我们注释掉所有的内容并使用上面的四行。

# export train_cmd="queue.pl --mem 4G"
# export decode_cmd="queue.pl --mem 4G"
# export mkgraph_cmd="queue.pl --mem 8G"

# the use of cuda_cmd is deprecated but it's still sometimes used in nnet1
# example scripts.
# export cuda_cmd="queue.pl --gpu 1"

# if [ "$(hostname)" == "fit.vutbr.cz" ]; then
#   #b) BUT cluster options
#   queue="all.q@@blade,all.q@@speech"
#   gpu_queue="long.q@@gpu"
#   storage="matylda5"
#   export train_cmd="queue.pl -q $queue -l ram_free=1.5G,mem_free=1.5G,${storage}=0.5"
#   export decode_cmd="queue.pl -q $queue -l ram_free=2.5G,mem_free=2.5G,${storage}=0.1"
#   export cuda_cmd="queue.pl -q $gpu_queue -l gpu=1"
# fi

使用Kaldi运行了timit的S5实例,只运行到了“tri3 : LDA + MLLT + SAT Training & Decoding”这一步,后面的”SGMM2”,”MMI+SGMM2”,”DNN + SGMM2”都没有运行成功,原因是在跑SGMM2的时候可能是由于机器配置不够,导致资源消耗完,就卡住了,此时内存占用率达到90%,我的主机是4G内存,分配给虚拟机是2G,以后想办法在更好的机器上跑一下。下面贴出tr3及其前面的tr2,tr1,单音素等的识别错误率,效果貌似还不错。 
输入以下代码来看一下部分结果:

#!/bin/bash
for x in exp/{mono,tri,sgmm,dnn,combine}*/decode*; do [ -d $x ] && echo $x | grep "${1:-.*}" >/dev/null && grep WER $x/wer_* 2>/dev/null | utils/best_wer.sh; done
for x in exp/{mono,tri,sgmm,dnn,combine}*/decode*; do [ -d $x ] && echo $x | grep "${1:-.*}" >/dev/null && grep Sum $x/score_*/*.sys 2>/dev/null | utils/best_wer.sh; done

得到结果如下:

%WER 33.10 [ 4984 / 15057, 398 ins, 1673 del, 2913 sub ] exp/mono/decode_dev/wer_3  
%WER 34.05 [ 2457 / 7215, 186 ins, 839 del, 1432 sub ] exp/mono/decode_test/wer_3 
%WER 28.98 [ 4363 / 15057, 547 ins, 1244 del, 2572 sub ] exp/tri1/decode_dev/wer_6  
%WER 30.71 [ 2216 / 7215, 328 ins, 588 del, 1300 sub ] exp/tri1/decode_test/wer_5 
%WER 26.41 [ 3977 / 15057, 487 ins, 1150 del, 2340 sub ] exp/tri2/decode_dev/wer_6  
%WER 27.36 [ 1974 / 7215, 178 ins, 685 del, 1111 sub ] exp/tri2/decode_test/wer_8  
%WER 23.32 [ 3511 / 15057, 480 ins, 1002 del, 2029 sub ] exp/tri3/decode_dev/wer_4  
%WER 26.98 [ 4062 / 15057, 552 ins, 1092 del, 2418 sub ] exp/tri3/decode_dev.si/wer_5 

猜你喜欢

转载自blog.csdn.net/sun___shy/article/details/82423707