Skip to content

Latest commit

 

History

History
94 lines (77 loc) · 3.71 KB

installation.md

File metadata and controls

94 lines (77 loc) · 3.71 KB

Building wav2letter++

Build Requirements

  • A C++ compiler with good C++ 11 support (e.g. g++ >= 4.8)
  • cmake — version 3.5.1 or later, make

Dependencies

  • flashlight is required. flashlight must be built with distributed training enabled.
  • libsndfile is required for loading audio. If using wav2letter++ with flac files, libsndfile must be built with Ogg, Vorbis and FLAC libraries.
  • Intel's Math Kernel Library is required for featurization.
  • FFTW is required for featurization.
  • KenLM is required for the decoder. One of LZMA, BZip2, or Z is required for LM compression with KenLM.
  • gflags is required.
  • glog is required.
  • gtest and gmock >= 1.8.0 are required if building tests.

Optional Dependencies

  • flashlight requires CUDA >= 9.2; if building wav2letter++ with the CUDA criterion backend, CUDA >= 9.2 is required. Using CUDA 9.2 is recommended.
  • If building with the CPU criterion backend, wav2letter++ will try to compile with OpenMP, for better performance.

Build Options

Options Configuration Default Value
CRITERION_BACKEND CUDA, CPU CUDA
BUILD_TESTS ON, OFF ON
CMAKE_BUILD_TYPE CMake build types Debug

General Build Instructions

First, clone the repository:

git clone --recursive https://github.com/facebookresearch/wav2letter.git

and follow the build instructions for your specific OS.

There is no install procedure currently supported for wav2letter++. Building produces three binaries in the build directory:

  • Train: given a dataset of input audio and corresponding transcriptions in sub-word units (graphemes, phonemes, etc), trains the acoustic model.
  • Test: performs inference on a given dataset with an acoustic model.
  • Decode: given an acoustic model/pre-computed network emissions and a language model, computes the most likely sequence of words for a given dataset.

Building on Linux

wav2letter++ has been tested on Ubuntu 16.04 and CentOS 7.5.

Building on Linux is simple. Once you've downloaded wav2letter++ and built and installed the required dependencies:

# in your wav2letter++ directory
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCRITERION_BACKEND=[backend]
make -j4 # (or any number of threads)

Building/Running with Docker

wav2letter++ and its dependencies can also be built with the provided Dockerfile. Only the CUDA backend is supported with Docker at this time.

To build wav2letter++ with Docker:

  • Install Docker and nvidia-docker

  • Run the docker image with CUDA backend in a new container:

    sudo docker run --runtime=nvidia --rm -itd --ipc=host --name w2l wav2letter/wav2letter:cuda-latest
    sudo docker exec -it w2l bash
    
  • To run tests inside a container

    cd /root/wav2letter/build && make test
    
  • Build Docker image from source:

    git clone --recursive https://github.com/facebookresearch/wav2letter.git
    cd wav2letter
    sudo docker build -f ./Dockerfile-CUDA -t wav2letter .
    

    For logging during training/testing/decoding inside a container use flag --logtostderr=1.