Skip to content

Commit

Permalink
Fix #3071: Don't reinstall TensorFlow on top of TensorFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Lissy committed Jun 17, 2020
1 parent 2514b67 commit 2ad98d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
17 changes: 9 additions & 8 deletions Dockerfile.train.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
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

WORKDIR /
RUN git lfs install
RUN git clone $DEEPSPEECH_REPO

WORKDIR /DeepSpeech
RUN git checkout $DEEPSPEECH_SHA

# Setup a virtualenv otherwise we mess with the system and this is BAD.
RUN python3 -m venv venv/

ENV VIRTUAL_ENV=/DeepSpeech/venv
ENV PATH=$VIRTUAL_ENV/bin:$PATH

# 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.0.2 wheel==0.34.2 setuptools==46.1.3

# Install DeepSpeech, no need for the decoder since we did it earlier
RUN DS_NODECODER=y pip3 install --upgrade --force-reinstall -e .
# 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 --force-reinstall -e .

RUN ./bin/run-ldc93s1.sh
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def main():
version = fin.read().strip()

install_requires_base = [
'tensorflow == 1.15.2',
'numpy',
'progressbar2',
'six',
Expand All @@ -74,6 +73,10 @@ def main():
'ds_ctcdecoder == {}'.format(version)
]

tensorflow_pypi_dep = [
'tensorflow == 1.15.2'
]

# Due to pip craziness environment variables are the only consistent way to
# get options into this script when doing `pip install`.
tc_decoder_artifacts_root = os.environ.get('DECODER_ARTIFACTS_ROOT', '')
Expand All @@ -87,6 +90,11 @@ def main():
else:
install_requires = install_requires_base + decoder_pypi_dep

if len(os.environ.get('DS_NOTENSORFLOW', '')) > 0:
install_requires = install_requires_base
else:
install_requires = install_requires_base + tensorflow_pypi_dep

setup(
name='deepspeech_training',
version=version,
Expand Down

0 comments on commit 2ad98d6

Please sign in to comment.