Wav2Letter++

Docker installation

Inference docker

Install docker image

Size: 4.7 Gb

sudo docker run --rm -itd --ipc=host --name w2l wav2letter/wav2letter:inference-latest

The same, but mount a directory inside the container (N.B. this example used CUDA, not CPU):

```sudo docker run --runtime=nvidia --rm -itd --ipc=host \ --volume original/path/on/your/machine:mounted/path/in/the/container --name w2l wav2letter/wav2letter:cuda-latest


Check you have the image:

`docker image ls`

The name is `wav2letter/wav2letter`.

### First-time setup

To create a container from this image *and immediately boot it up*, run:

`docker run -it wav2letter/wav2letter:inference-latest`

The part after the colon is the "tag" of the specific build.
You need to provide the `-it` flag to get a tty in the container with an interactive shell.
If you forget this, the start command below will not work.

## Enter container

To start a container again (but not create a new one from an image) it is most straightforward to use `start`:

`docker start [CONTAINER NAME]`.


### Open shell in running container

After that first time setup, your container is already running.
Now you want to open a shell in that container with:

`docker exec -it [container] /bin/bash` 

You can use the name or the container ID.
Find them with `docker ps -a` or `docker container ls -a`.
In my case, CONTAINER ID is `eedb517cc048` and the NAME is w2l.

## Running tests

Doc says to run:

`cd /root/wav2letter/build && make test`

But make test does not seem to exist. 
I inspected the Make file, and there is a `gtest` though, so run instead:

`cd /root/wav2letter/build && make gtest`

Issue maken?

## Update flashlight and wav2letter inside the container



Doc says to run this command:

export KENLM_ROOT_DIR=/root/kenlm && \ cd /root/wav2letter && git remote set-url https://github.com/facebookresearch/wav2letter.git && \ git pull && rm -rf build/* && \ cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DW2L_BUILD_LIBRARIES_ONLY=ON -DW2L_LIBRARIES_USE_CUDA=OFF -DW2L_BUILD_INFERENCE=ON && \ make -j8 ```

Test wav2letter in the container

cd /root/wav2letter/build && make test

And:

docker stop [container ID]