Kaldi语音识别快速入门

一.简介

  Kaldi是使用C++编写的语音识别工具包,Apache License v2.0许可。主要供语音识别研究人员使用。Kaldi的目标和范围与HTK类似。目标是拥有易于修改和扩展的现代而灵活的代码。主要功能包括:

  1.与有限状态传感器FST的代码进行集成,根据OpenFst工具箱【作为库】进行编译。

  2.广泛的线性代数支持,包括一个包装标准BLAS和LAPACK例程的矩阵库。

  3.可扩展的设计,以方便使用为目的提供算法。

  

二.安装Kaidi

  1.下载

    在Linux你要安装的目录下执行:git clone https://github.com/kaldi-asr/kaldi.git kaldi --origin upstream

  2.更新

    当需要更新时,可以执行:git pull

  3.安装环境

    理想的计算环境是运行在SGE【Sun GridEngine】的Linux机器的集群上,可以通过NFS或某些类似的网络文件系统访问共享目录。在理想情况下,网格上的某些计算机将具有NVidia GPU,这样可以将它们用于神经网络的训练,并且可以通过向qsub添加一些额外的选型将它们保留在队列中。在实际情况或用于学习时,可能单机是比较普遍的,在单机情况下,Kaldi是可以运行的,尽管这样做会执行的慢一点,并且可能必须要减少某些示例脚本中使用的作业数量,以免耗尽机器的内存。

  4.所需的软件包

    1.Git这是下载Kaldi及其依赖的其他软件所必须的。

    2.wget是安装某些非Kaldi组件时所必须的。

    3.示例脚本需要标准的UNIX实用程序,例如bash,perl,awk,grep和make。

  5.安装依赖

    执行命令:cd kaldi/tools/

    执行命令:./check_dependencies.sh脚本检查需要安装的依赖

    

    注意:你的机器上可能提示的比这多,这就需要单独执行yum install xxx -y进行逐个安装!

    在安装可能会报这个异常:

    

    此时可以安装gcc的gfortran

    

    

    再次执行检测脚本,可以查看已经完成所有依赖的安装

    

  6.编译【tools目录下】

    然后执行:cd .. 回退到上一级,接着执行make进行编译【make中也会执行检测脚本】

    

    若最后提示报错:

    

    这是因为openfst-1.6.7在解压时内存不足报错,之后重试时重新下载了jar包命名为openfst-1.6.7.tar.gz.1。解决方案是删除之前解压好的文件夹,之后重解压压缩文件,之后重新执行make进行编译。若报以下警告:

    

    安装IRSTLM

    

  7.检测外部库安装情况

    

  8.预编译   

[root@slave01 src]# make depend
make -C base/ depend
./get_version.sh: Git history is not available. ./get_version.sh: Using the version number "5.4" specified in src/.version.
make[1]: Entering directory `/usr/local/soft/kaldi/src/base'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/base'
make -C matrix/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/matrix'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/matrix'
make -C util/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/util'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/util'
make -C feat/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/feat'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/feat'
make -C tree/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/tree'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/tree'
make -C gmm/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/gmm'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/gmm'
make -C transform/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/transform'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/transform'
make -C fstext/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/fstext'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/fstext'
make -C hmm/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/hmm'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/hmm'
make -C lm/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/lm'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/lm'
make -C decoder/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/decoder'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/decoder'
make -C lat/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/lat'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/lat'
make -C kws/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/kws'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/kws'
make -C cudamatrix/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/cudamatrix'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/cudamatrix'
make -C nnet/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/nnet'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/nnet'
make -C bin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/bin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/bin'
make -C fstbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/fstbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/fstbin'
make -C gmmbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/gmmbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/gmmbin'
make -C fgmmbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/fgmmbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/fgmmbin'
make -C featbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/featbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/featbin'
make -C nnetbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/nnetbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/nnetbin'
make -C latbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/latbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/latbin'
make -C sgmm2/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/sgmm2'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/sgmm2'
make -C sgmm2bin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/sgmm2bin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/sgmm2bin'
make -C nnet2/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/nnet2'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/nnet2'
make -C nnet3/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/nnet3'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/nnet3'
make -C rnnlm/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/rnnlm'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/rnnlm'
make -C chain/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/chain'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/chain'
make -C nnet3bin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/nnet3bin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/nnet3bin'
make -C nnet2bin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/nnet2bin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/nnet2bin'
make -C kwsbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/kwsbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/kwsbin'
make -C ivector/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/ivector'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/ivector'
make -C ivectorbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/ivectorbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/ivectorbin'
make -C online2/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/online2'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/online2'
make -C online2bin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/online2bin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include  -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/online2bin'
make -C lmbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/lmbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/lmbin'
make -C chainbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/chainbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/chainbin'
make -C rnnlmbin/ depend
make[1]: Entering directory `/usr/local/soft/kaldi/src/rnnlmbin'
g++ -M -std=c++11 -I.. -I/usr/local/soft/kaldi/tools/openfst/include -Wno-sign-compare -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/soft/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g  *.cc > .depend.mk
make[1]: Leaving directory `/usr/local/soft/kaldi/src/rnnlmbin'
View Code

  9.编译【src目录下】

    执行make进行编译【make中也会执行检测脚本】

    

    编译成功!

  10.测试

    

    

    这就表示安装成功了!

    

三.分布式概述

  在执行示例脚本之前,我们先花费一点时间看一下Kaldi发行版中还包含哪些内容。进入kaldi目录,有一些文件和子目录。重要的子目录是tools、src和egs,下面重点介绍tools和src。

  一.tools目录

    

    目录tools是我们以各种方式安装Kaldi所依赖的组件的目录。其中大多数是由make命令安装的东西。在INSTALL文件中提供了有关如何安装工具的说明。

    

    最重要的子目录是OpenFst的子目录。如果Kaldi安装成功,将存在一个包含已安装二进制文件的bin目录和包含该库的lib目录。其中目录include/fst/中包含了重要的代码。如果想要深入了解Kaldi,则需要了解OpenFst【有兴趣了解的前往:http://www.openfst.org/】。

    接下来将执行示例命令进行配置:

    1.进入bin目录

    

    2.执行命令创建text.fst文件

    

    3.执行命令创建isyms.txt文件

    

    4.执行命令创建osyms.txt文件

    

    5.查看

    

    6.配置PATH路径

    

    7.创建一个二进制格式的FST

    

    

    8.执行复制命令,所得的WFST,binary2.fst,其类似于binary.fst,但其权重是binary.fst的两倍,如下:

    

    

  二.src目录

    src目录包含了一系列代码的列表。其中包含Makefile的目标之一,test测试命令。该命令进入各个子目录并在其中运行测试程序。所有的测试都应该成功。如果必要,可以运行make valgrind,这将使用内存检查器运行相同的测试,并且会花费更多的时间,也会包很多错误。可以使用ctr+c停止运行。

    

    参照上面报错日志的提示,执行配置脚本:./configure

    

     配置成功后执行测试程序make test

    

    这样,基础安装配置就已经完成了!

posted @ 2019-12-11 19:02  云山之巅  阅读(5541)  评论(0编辑  收藏  举报