-
Notifications
You must be signed in to change notification settings - Fork 1k
Building Running with Docker
wav2letter++ and its dependencies can also be built with the provided Dockerfile. Both CUDA and CPU backends are supported with Docker
To use wav2letter++ with Docker:
-
Install Docker and, if using the CUDA backend, nvidia-docker
-
Run the docker image with CUDA/CPU backend in a new container:
# with CUDA backend (for CUDA 9.2) sudo docker run --runtime=nvidia --rm -itd --ipc=host --name w2l wav2letter/wav2letter:cuda-latest # with CUDA backend (for CUDA 10) sudo docker run --runtime=nvidia --rm -itd --ipc=host --name w2l wav2letter/wav2letter:cuda-10-latest # or with CPU backend sudo docker run --rm -itd --ipc=host --name w2l wav2letter/wav2letter:cpu-latest # go into bash in the container sudo docker exec -it w2l bash -
One can also mount any necessary directories into a container, for example:
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 -
To run tests inside a container
cd /root/wav2letter/build && make test -
Update
flashlightandwav2letterinside a container to have current master- for CUDA backend
cd /root/flashilight && git pull cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CUDA && \ make -j8 && make install export MKLROOT=/opt/intel/mkl && export KENLM_ROOT_DIR=/root/kenlm && \ rm -rf /root/wav2letter && cd /root && \ git clone --recursive https://github.com/facebookresearch/wav2letter.git && \ cd /root/wav2lettr && mkdir -p build && \ cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DW2L_LIBRARIES_USE_CUDA=ON -DW2L_BUILD_INFERENCE=ON && \ make -j8 && \ - for CPU backend
cd /root/flashilight && git pull cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CPU && \ make -j8 && make install export KENLM_ROOT_DIR=/root/kenlm && \ rm -rf /root/wav2letter && cd /root && \ git clone --recursive https://github.com/facebookresearch/wav2letter.git && \ cd /root/wav2lettr && mkdir -p build && \ cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DW2L_LIBRARIES_USE_CUDA=OFF -DW2L_BUILD_INFERENCE=ON && \ make -j8
- for CUDA backend
To build Docker image from the source (using --no-cache will provide the latest version of flashlight inside the image if you have built the image previously for earlier versions of wav2letter) run the following commands:
git clone --recursive https://github.com/facebookresearch/wav2letter.git
cd wav2letter
# for CUDA backend
sudo docker build --no-cache -f ./Dockerfile-CUDA -t wav2letter .
# for CPU backend
sudo docker build --no-cache -f ./Dockerfile-CPU -t wav2letter .
https://hub.docker.com/r/wav2letter/wav2letter/tags
For logging during training/testing/decoding inside a container, use the --logtostderr=1 --minloglevel=0 flag.