Skip to content

Fix #3071: Don't reinstall TensorFlow on top of TensorFlow #3072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
else:
install_requires = install_requires + tensorflow_pypi_dep

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