import ysy 2022. 9. 18. 21:51

설치전 요구사항:

  • OS: Ubuntu, CentOS, MacOSX, Windows, Cygwin 등
  • GCC >= 4.7

 

일단 아래 링크는 공식 github 주소인데, 그냥 제 포스팅 따라 오시면 됩니다.

참고로 리눅스(우분투) 기준으로 설명함.

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

 

GitHub - kaldi-asr/kaldi: kaldi-asr/kaldi is the official location of the Kaldi project.

kaldi-asr/kaldi is the official location of the Kaldi project. - GitHub - kaldi-asr/kaldi: kaldi-asr/kaldi is the official location of the Kaldi project.

github.com

 

 

시작


일단 클론부터 해야함(https://kaldi-asr.org/doc/install.html)

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

그 다음부터는 아래 링크에 따라 설치 진행하면 됩니다.

이 블로그 보고 하실 분들은 안가두 댐.

https://github.com/kaldi-asr/kaldi/blob/master/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.

 

Option 2 (cmake):

Go to cmake/ and follow INSTALL.md instructions there.

Note, it may not be well tested and some features are missing currently. 라고 적혀있음.


이제 kaldi폴더 안에 tools랑 src에 들어가서 필요한 파일 설치를 할거다.

각 폴더 안에 하나씩 INSTALL이라는 파일이 있어서 열면 자상한 설명이 있다.

 

자상한 설명 따라 아래와 같이 입력해주자.

cd tools
extras/check_dependencies.sh

위와 같이 입력하면 실패하면서 뭐가 막 뜬다.

더보기

extras/check_dependencies.sh: automake is not installed.
extras/check_dependencies.sh: autoconf is not installed.
extras/check_dependencies.sh: gfortran is not installed
extras/check_dependencies.sh: subversion is not installed
extras/check_dependencies.sh: python2.7 is not installed
extras/check_dependencies.sh: Intel MKL does not seem to be installed.
 ... Run extras/install_mkl.sh to install it. Some distros (e.g., Ubuntu 20.04) provide
 ... a version of MKL via the package manager, but verify that it is up-to-date.
 ... You can also use other matrix algebra libraries. For information, see:
 ...   http://kaldi-asr.org/doc/matrixwrap.html
extras/check_dependencies.sh: Some prerequisites are missing; install them using the command:
  sudo apt-get install automake autoconf gfortran subversion python2.7

에러코드에서 추천해준대로 해보자.

 sudo apt-get install automake autoconf gfortran subversion python2.7

다시

extras/check_dependencies.sh

입력하면 또 뭐가 뜬다.

더보기

extras/check_dependencies.sh: python2.7 is installed, but the python2 binary does not exist. Creating a symlink and adding this to tools/env.sh
extras/check_dependencies.sh: WARNING python 2.7 is not the default python. We fixed this by adding a correct symlink more prominently on the path.
 ... If you really want to use python 3.8.10 as default, add an empty file /home/ysy/kaldi/tools/python/.use_default_python and run this script again.
extras/check_dependencies.sh: Intel MKL does not seem to be installed.
 ... Run extras/install_mkl.sh to install it. Some distros (e.g., Ubuntu 20.04) provide
 ... a version of MKL via the package manager, but verify that it is up-to-date.
 ... You can also use other matrix algebra libraries. For information, see:
 ...   http://kaldi-asr.org/doc/matrixwrap.html

INSTALL파일 열어본 사람들은 알겠지만 결과물을 잘 읽어보라고 했으므로

1. /home/ysy/kaldi/tools/python/.use_default_python 만들어줌.

2. 아래 실행해줌. sudo 필요하다는데 걍 해도 됐음.

extras/install_mkl.sh 

자 이제 다 했으면 아래 입력

make

더 빨리 하고 싶은 사람은 이렇게 쳐준다.

make -j 6

6은 자기 컴퓨터 cpu 개수에 맞춰서 조절하면 된다.

나는 cpu 12개짜리 쓰고 있어서 대충 그 반인 6개 할당함.

여러분 최대 cpu개수 하면 렉먹고 난리납니다.

반정도로 해주세요.

 

기다리지말고 다른 터미널 창 하나 더 열어서 src해주려고 했는데

앞에 거 다 하고 하래서 기다려주었다.

더보기

You must first have completed the installation steps in ../tools/INSTALL

다 됐으면 또 아래와 같이 해주면 된다.

Kaldi를 컴파일하고 설치하는 과정이다.

cd ..
cd src
./configure --shared
make depend -j 6
make -j 6

자 그럼 설치 완료!

 

반응형