-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathDockerfile
85 lines (73 loc) · 2.17 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
# >> START Install base software
# Get basic packages
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
bash-completion \
build-essential \
ca-certificates \
cmake \
curl \
g++ \
gcc \
git \
libbz2-dev \
libboost-all-dev \
libgsm1-dev \
libltdl-dev \
liblzma-dev \
libmagic-dev \
libpng-dev \
libsox-fmt-mp3 \
libsox-dev \
locales \
openjdk-8-jdk \
pkg-config \
python3 \
python3-dev \
python3-pip \
python3-wheel \
python3-numpy \
sox \
unzip \
wget \
zlib1g-dev
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
ENV PYTHON_BIN_PATH /usr/bin/python3.6
ENV PYTHON_LIB_PATH /usr/local/lib/python3.6/dist-packages
WORKDIR /
# Get DeepSpeech with the version 0.9.3
RUN git clone --branch v0.9.3 https://github.com/mozilla/DeepSpeech
RUN curl -sSL https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-checkpoint.tar.gz \
| tar xvz
# Get the scorer for CTC decoder
RUN curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer
# Copy required files
COPY attack.py .
COPY classify.py .
COPY tf_logits.py .
COPY mfcc.py .
COPY sample-000000.wav .
WORKDIR /DeepSpeech
# Install DeepSpeech dependencies
RUN pip3 install --upgrade pip==20.2.2 wheel==0.34.2 setuptools==49.6.0
RUN pip3 install --upgrade -e .
# Remove the numpy that causes dependency issues
RUN pip3 uninstall -y numpy
# Install the right version of numpy and the remaining packages
RUN pip3 install numpy==1.18.5 \
python_speech_features \
tables
RUN apt-get install python3-dev
# Install TensorFlow with GPU support
RUN pip3 uninstall -y tensorflow
RUN pip3 install 'tensorflow-gpu==1.15.4'
# Install vim for light editing
RUN apt-get -y install vim
# Done
WORKDIR /