Skip to content

Dependencies

Tatiana Likhomanenko edited this page Dec 10, 2019 · 1 revision

1. flashlight

wav2letter++ uses flashlight as its core ML backend.

  • Please follow the provided install procedures.
  • wav2letter++ requires flashlight built with distributed training enabled (default).

2. KenLM

wav2letter++ uses KenLM to allow beam-search decoding with an n-gram language model.

  • At least one of LZMA, BZip2, or Z is required for LM compression with KenLM.
  • It is highly recommended to build KenLM with position-independent code (-fPIC) enabled, to enable python compatibility.
  • After installing, run export KENLM_ROOT_DIR=... so that wav2letter++ can find it. This is needed because KenLM doesn't support a make install step.

Example build commands on Ubuntu:

sudo apt-get install liblzma-dev libbz2-dev libzstd-dev
git clone https://github.com/kpu/kenlm.git
cd kenlm
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DKENLM_MAX_ORDER=20 -DCMAKE_POSITION_INDEPENDENT_CODE=ON
make -j16
# don't forget to export KENLM_ROOT_DIR

3. Additional Dependencies

The following additional packages are required:

Example (Ubuntu). The following command will install all the above packages:

apt-get install libsndfile1-dev libopenblas-dev libfftw3-dev libgflags-dev libgoogle-glog-dev

4. Optional Notes

The following dependencies should be already installed for flashlight:

  • A C++ compiler with good C++11 support (e.g. g++ >= 4.8)
  • cmake >= 3.5.1, and make
  • CUDA >= 9.2, only if using CUDA backend

The following dependencies are automatically downloaded and built by cmake:

The following dependencies are optional:

  • OpenMP, if present, will be used for better performance.