linux 离线安装kaldi,kaldi环境安装- ubuntu16 安装kaldi

本文详细介绍了如何安装Kaldi语音识别工具包,包括克隆源码、检查依赖、安装组件如sox和autoconf。特别强调了在安装CUDA时遇到的问题,如驱动未安装和NVIDIA CUDA安装失败。解决方法是停止Xserver并重新安装CUDA,确保系统满足所有先决条件。最后,文章提到了Kaldi的编译步骤,包括在tools和src目录下执行make命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 克隆kaldi

git clone https://github.com/kaldi-asr/kaldi

2. 检查依赖

进入kaldi主目录,可以查看INSTALL文件,里面记录了安装的相关指令,如下:

This is the official Kaldi INSTALL. Look also at INSTALL.md for the git mirror installation.

[Option 1 in the following does not apply to native Windows install, see windows/INSTALL or following Option 2]

Option 1 (bash + makefile):

Steps:

(1)

go to tools/ and follow INSTALL instructions there.

(2)

go to src/ and follow INSTALL instructions there.

根据安装指令,cd 进入 tools 目录,查看tools 目录细的INSTALL文件,如下

To check the prerequisites for Kaldi, first run

extras/check_dependencies.sh

and see if there are any system-level installations you need to do. Check the

output carefully. There are some things that will make your life a lot easier

if you fix them at this stage. If your system default C++ compiler is not

supported, you can do the check with another compiler by setting the CXX

environment variable, e.g.

CXX=g++-4.8 extras/check_dependencies.sh

Then run

make

运行 extras/check_dependencies.sh 检查依赖是否满足,根据提示安装组件,比如:

sudo apt-get install sox

sudo apt-get install autoconf

当运行 extras/check_dependencies.sh ,返回以下结果的时候,则说明依赖安装完毕:

extras/check_dependencies.sh

extras/check_dependencies.sh: all OK.

** 特别说明安装 intel MKL(也可以用openblas或者其它底层数学库代替,具体可以参考http://kaldi-asr.org/doc/matrixwrap.html ),可能下载比较慢,需要耐心等待

./extras/install_sh

根据Base Installer 的提示,在命令行输入以下指令;

wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run

sudo sh cuda_10.2.89_440.33.01_linux.run

3. cuda安装一直会失败,查看log如下:

>sudo sh cuda_10.1.243_418.87.00_linux.run

Log:

/var/log/cuda-installer.log

1 [INFO]: Driver not installed.

2 [INFO]: Checking compiler version...

3 [INFO]: gcc location: /bin/gcc

4

5 [INFO]: gcc version: gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

6

7 [INFO]: Initializing menu

8 [INFO]: Setup complete

9 [INFO]: Components to install:

10 [INFO]: Driver

11 [INFO]: 418.87.00

12 [INFO]: Executing NVIDIA-Linux-x86_64-418.87.00.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd 2>&1

13 [INFO]: Finished with code: 256

14 [ERROR]: Install of driver component failed.

15 [ERROR]: Install of 418.87.00 failed, quitting

4. 起初怀疑是 Disabling Nouveau 的问题,按照document的操作,发现安装仍然失败;

5. 后来试了很多方法,发现是要 stop x server(stop the display manager in order to stop the X server),解决办法如下:

1. To find out your display manager, you can try running

pgrep -l dm

2. Follow these steps for cleaning:

apt-get --purge -y remove 'cuda*'

apt-get --purge -y remove 'nvidia*'

apt autoremove -y

apt-get clean

reboot

3. Go to the CUDA download site. Click on Linux -> x86_64 -> Ubuntu -> 18.04 -> Deb (local) And follow the Installation Instructions.

编译kaldi,在 tools/ 目录下面输入 make -j 4

make - j 4

编译src目录,cd 到 src 目录,configure有许多选项,具体可以额参考document,输入以下指令:

./configure --shared

make depend -j 8

make -j 8

这样kaldi就安装完了,也可以不安装cuda(没有N卡的时候),这样就不能运行DNN部分;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值