From bf243f54de39504236609aa55222ac36d68f4ef4 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 6 Dec 2020 22:31:51 -0800 Subject: [PATCH] new docker for new project --- chipsy-training/Dockerfile | 68 ++++++++++++++++++++++++++++++++++++++ chipsy-training/readme | 6 ++++ 2 files changed, 74 insertions(+) create mode 100644 chipsy-training/Dockerfile create mode 100644 chipsy-training/readme diff --git a/chipsy-training/Dockerfile b/chipsy-training/Dockerfile new file mode 100644 index 0000000..c8b077d --- /dev/null +++ b/chipsy-training/Dockerfile @@ -0,0 +1,68 @@ +# Please refer to the TRAINING documentation, "Basic Dockerfile for training" + +FROM tensorflow/tensorflow:1.15.4-gpu-py3 +ENV DEBIAN_FRONTEND=noninteractive + +ENV DEEPSPEECH_REPO=https://github.com/mozilla/DeepSpeech.git +ENV DEEPSPEECH_SHA=origin/master + +RUN apt-get update && apt-get install -y --no-install-recommends \ + apt-utils \ + bash-completion \ + build-essential \ + cmake \ + curl \ + git \ + libboost-all-dev \ + libbz2-dev \ + locales \ + python3-venv \ + unzip \ + wget + +# We need to remove it because it's breaking deepspeech install later with +# weird errors about setuptools +RUN apt-get purge -y python3-xdg + +# Install dependencies for audio augmentation +RUN apt-get install -y --no-install-recommends libopus0 libsndfile1 + +# Try and free some space +RUN rm -rf /var/lib/apt/lists/* + +WORKDIR / +RUN git clone $DEEPSPEECH_REPO DeepSpeech + +WORKDIR /DeepSpeech +RUN git checkout $DEEPSPEECH_SHA + +# Build CTC decoder first, to avoid clashes on incompatible versions upgrades +RUN cd native_client/ctcdecode && make NUM_PROCESSES=$(nproc) bindings +RUN pip3 install --upgrade native_client/ctcdecode/dist/*.whl + +# Prepare deps +RUN pip3 install --upgrade pip==20.2.2 wheel==0.34.2 setuptools==49.6.0 + +# Install DeepSpeech +# - No need for the decoder since we did it earlier +# - There is already correct TensorFlow GPU installed on the base image, +# we don't want to break that +RUN DS_NODECODER=y DS_NOTENSORFLOW=y pip3 install --upgrade -e . + +# Tool to convert output graph for inference +RUN python3 util/taskcluster.py --source tensorflow --branch r1.15 \ + --artifact convert_graphdef_memmapped_format --target . + +# Build KenLM to generate new scorers +WORKDIR /DeepSpeech/native_client +RUN rm -rf kenlm && \ + git clone https://github.com/kpu/kenlm && \ + cd kenlm && \ + git checkout 87e85e66c99ceff1fab2500a7c60c01da7315eec && \ + mkdir -p build && \ + cd build && \ + cmake .. && \ + make -j $(nproc) +WORKDIR /DeepSpeech + +RUN ./bin/run-ldc93s1.sh diff --git a/chipsy-training/readme b/chipsy-training/readme new file mode 100644 index 0000000..114ba85 --- /dev/null +++ b/chipsy-training/readme @@ -0,0 +1,6 @@ +Chipsy Training environment +=========================== + +The setup for Chipsy(voice assistant thing) to train in. +Courtesy of Mozilla :^) +