本文介绍了Ubuntu 16.04上的Kaldi工具包安装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Ubuntu 16.04上安装用于语音识别的Kaldi工具包.我已按照INSTALL文件中的说明进行操作.

Hi I am trying to install Kaldi toolkit for speech recognition on Ubuntu 16.04. I have followed instructions in INSTALL file.

在工具中的INSTALL文件中遵循以下过程,并得到以下输出,

Followed procedure in INSTALL file in tools and got following output,

../tools/extras/check_dependencies.sh: all OK.

并执行make,没有任何错误.这是最后几行,以防万一你想看看

and executed make without any errors. Here are last few lines in case if you want to take a look

rm -f openfst
ln -s openfst-1.6.1 openfst

Warning: IRSTLM is not installed by default anymore. If you need IRSTLM
Warning: use the script extras/install_irstlm.sh
All done OK.

现在我继续下一步

在src文件夹中,用以下输出执行configure

in src folder, executed configure with following output

Configuring ...Backing up kaldi.mk to kaldi.mk.bak ...Checking compiler g++-4.9 ...Checking OpenFst library in /home/xxx/Downloads/kaldi/tools/openfst ...Doing OS specific configurations ...On Linux: Checking for linear algebra header files ...Using ATLAS as the linear algebra library.Successfully configured for Debian/Ubuntu Linux [dynamic libraries] with ATLASLIBS =/usr/lib/libatlas.so.3 /usr/lib/libf77blas.so.3 /usr/lib/libcblas.so.3 /usr/lib/liblapack_atlas.so.3CUDA will not be used! If you have already installed cuda drivers and cuda toolkit, try using --cudatk-dir=... option. Note: this isonly relevant for neural net experimentsInfo: configuring Kaldi not to link with Speex (don't worry, it's only needed if youintend to use 'compress-uncompress-speex', which is very unlikely)SUCCESSTo compile: make clean -j; make depend -j; make -j ... or e.g. -j 10, instead of -j, to use a specified number of CPUsdebug mode enabled...+ exit 0

Configuring ...Backing up kaldi.mk to kaldi.mk.bak ...Checking compiler g++-4.9 ...Checking OpenFst library in /home/xxx/Downloads/kaldi/tools/openfst ...Doing OS specific configurations ...On Linux: Checking for linear algebra header files ...Using ATLAS as the linear algebra library.Successfully configured for Debian/Ubuntu Linux [dynamic libraries] with ATLASLIBS =/usr/lib/libatlas.so.3 /usr/lib/libf77blas.so.3 /usr/lib/libcblas.so.3 /usr/lib/liblapack_atlas.so.3CUDA will not be used! If you have already installed cuda drivers and cuda toolkit, try using --cudatk-dir=... option. Note: this isonly relevant for neural net experimentsInfo: configuring Kaldi not to link with Speex (don't worry, it's only needed if youintend to use 'compress-uncompress-speex', which is very unlikely)SUCCESSTo compile: make clean -j; make depend -j; make -j ... or e.g. -j 10, instead of -j, to use a specified number of CPUsdebug mode enabled...+ exit 0

$ make depend也已执行,没有任何错误.但是当我执行make时,出现以下错误(我不会复制所有内容,因为它很长,如果有人希望我可以发布完整的输出)

$ make depend also executed without any errors. But when I execute make, I get following error (I'm not copying everything because it is very long, if anyone wants I can post full output)

make[2]: Entering directory '/home/srinivas/Downloads/kaldi/src/online2'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/srinivas/Downloads/kaldi/src/online2'
make -C bin
make[2]: Entering directory '/home/srinivas/Downloads/kaldi/src/bin'
g++-4.9  -Wl,-rpath=/home/srinivas/Downloads/kaldi/tools/openfst/lib -rdynamic  align-equal.o ../decoder/kaldi-decoder.a ../lat/kaldi-lat.a ../lm/kaldi-lm.a ../fstext/kaldi-fstext.a ../hmm/kaldi-hmm.a ../transform/kaldi-transform.a ../gmm/kaldi-gmm.a ../tree/kaldi-tree.a ../util/kaldi-util.a ../thread/kaldi-thread.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a   /home/srinivas/Downloads/kaldi/tools/openfst/lib/libfst.so /usr/lib/libatlas.so.3 /usr/lib/libf77blas.so.3 /usr/lib/libcblas.so.3 /usr/lib/liblapack_atlas.so.3 -lm -lpthread -ldl -o align-equal
align-equal.o: In function `fst::internal::FstImpl<fst::ArcTpl<fst::TropicalWeightTpl<float> > >::WriteFstHeader(fst::Fst<fst::ArcTpl<fst::TropicalWeightTpl<float> > > const&, std::ostream&, fst::FstWriteOptions const&, int, std::string const&, unsigned long, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:745: undefined reference to `fst::FstHeader::Write(std::ostream&, std::string const&) const'
../decoder/kaldi-decoder.a(training-graph-compiler.o): In function `fst::internal::FstImpl<fst::ReverseArc<fst::ArcTpl<fst::TropicalWeightTpl<float> > > >::WriteFstHeader(fst::Fst<fst::ReverseArc<fst::ArcTpl<fst::TropicalWeightTpl<float> > > > const&, std::ostream&, fst::FstWriteOptions const&, int, std::string const&, unsigned long, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:745: undefined reference to `fst::FstHeader::Write(std::ostream&, std::string const&) const'
../decoder/kaldi-decoder.a(training-graph-compiler.o): In function `fst::internal::FstImpl<fst::ArcTpl<fst::LogWeightTpl<float> > >::WriteFstHeader(fst::Fst<fst::ArcTpl<fst::LogWeightTpl<float> > > const&, std::ostream&, fst::FstWriteOptions const&, int, std::string const&, unsigned long, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:745: undefined reference to `fst::FstHeader::Write(std::ostream&, std::string const&) const'
../fstext/kaldi-fstext.a(kaldi-fst-io.o): In function `fst::ReadFstKaldi(std::string)':
/home/srinivas/Downloads/kaldi/src/fstext/kaldi-fst-io.cc:34: undefined reference to `fst::FstHeader::Read(std::istream&, std::string const&, bool)'
/home/srinivas/Downloads/kaldi/src/fstext/kaldi-fst-io.cc:37: undefined reference to `fst::FstReadOptions::FstReadOptions(std::string const&, fst::FstHeader const*, fst::SymbolTable const*, fst::SymbolTable const*)'
../fstext/kaldi-fstext.a(kaldi-fst-io.o): In function `fst::internal::FstImpl<fst::ArcTpl<fst::TropicalWeightTpl<float> > >::ReadHeader(std::istream&, fst::FstReadOptions const&, int, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:796: undefined reference to `fst::FstHeader::Read(std::istream&, std::string const&, bool)'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'align-equal' failed
make[2]: *** [align-equal] Error 1
make[2]: Leaving directory '/home/srinivas/Downloads/kaldi/src/bin'
Makefile:142: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/home/srinivas/Downloads/kaldi/src'
Makefile:35: recipe for target 'all' failed
make: *** [all] Error 2

我什至手动搜索了库,它们位于../tools/openfst位置.我什至尝试在系统范围内安装openfst,但没有任何效果.任何帮助都将被申请.谢谢!

I've even manually searched for libraries and they are present in the location ../tools/openfst. I even tried system wide installation of openfst, but nothing worked. Any help would be appriciated. Thanks!

推荐答案

我使用g ++-5解决了该问题.默认情况下,Ubuntu 16.04将g ++-5用于预安装的软件包,当我尝试使用g ++-4.9编译Kaldi并与使用g ++-5的Ubuntu软件包链接时,链接器会导致未定义的引用.我也面临着其他图书馆的类似问题

I solved it using g++-5. Ubuntu 16.04 by default uses g++-5 for pre-installed packages and when I try to compile Kaldi with g++-4.9 and link with Ubuntu packages that used g++-5, linker caused undefined references. I was facing similar issue with other libraries as well

这篇关于Ubuntu 16.04上的Kaldi工具包安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 06:05