Merge pull request #3072 from lissyx/docker-train
Fix #3071: Don't reinstall TensorFlow on top of TensorFlow
This commit is contained in:
commit
b7fa0ade33
@ -18,6 +18,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
unzip \
|
unzip \
|
||||||
wget
|
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 /
|
WORKDIR /
|
||||||
RUN git lfs install
|
RUN git lfs install
|
||||||
RUN git clone $DEEPSPEECH_REPO
|
RUN git clone $DEEPSPEECH_REPO
|
||||||
@ -25,12 +29,6 @@ RUN git clone $DEEPSPEECH_REPO
|
|||||||
WORKDIR /DeepSpeech
|
WORKDIR /DeepSpeech
|
||||||
RUN git checkout $DEEPSPEECH_SHA
|
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
|
# Build CTC decoder first, to avoid clashes on incompatible versions upgrades
|
||||||
RUN cd native_client/ctcdecode && make NUM_PROCESSES=$(nproc) bindings
|
RUN cd native_client/ctcdecode && make NUM_PROCESSES=$(nproc) bindings
|
||||||
RUN pip3 install --upgrade native_client/ctcdecode/dist/*.whl
|
RUN pip3 install --upgrade native_client/ctcdecode/dist/*.whl
|
||||||
@ -38,7 +36,10 @@ RUN pip3 install --upgrade native_client/ctcdecode/dist/*.whl
|
|||||||
# Prepare deps
|
# Prepare deps
|
||||||
RUN pip3 install --upgrade pip==20.0.2 wheel==0.34.2 setuptools==46.1.3
|
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
|
# Install DeepSpeech
|
||||||
RUN DS_NODECODER=y pip3 install --upgrade --force-reinstall -e .
|
# - 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
|
RUN ./bin/run-ldc93s1.sh
|
||||||
|
10
setup.py
10
setup.py
@ -50,7 +50,6 @@ def main():
|
|||||||
version = fin.read().strip()
|
version = fin.read().strip()
|
||||||
|
|
||||||
install_requires_base = [
|
install_requires_base = [
|
||||||
'tensorflow == 1.15.2',
|
|
||||||
'numpy',
|
'numpy',
|
||||||
'progressbar2',
|
'progressbar2',
|
||||||
'six',
|
'six',
|
||||||
@ -74,6 +73,10 @@ def main():
|
|||||||
'ds_ctcdecoder == {}'.format(version)
|
'ds_ctcdecoder == {}'.format(version)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
tensorflow_pypi_dep = [
|
||||||
|
'tensorflow == 1.15.2'
|
||||||
|
]
|
||||||
|
|
||||||
# Due to pip craziness environment variables are the only consistent way to
|
# Due to pip craziness environment variables are the only consistent way to
|
||||||
# get options into this script when doing `pip install`.
|
# get options into this script when doing `pip install`.
|
||||||
tc_decoder_artifacts_root = os.environ.get('DECODER_ARTIFACTS_ROOT', '')
|
tc_decoder_artifacts_root = os.environ.get('DECODER_ARTIFACTS_ROOT', '')
|
||||||
@ -87,6 +90,11 @@ def main():
|
|||||||
else:
|
else:
|
||||||
install_requires = install_requires_base + decoder_pypi_dep
|
install_requires = install_requires_base + decoder_pypi_dep
|
||||||
|
|
||||||
|
if os.environ.get('DS_NOTENSORFLOW', ''):
|
||||||
|
install_requires = install_requires
|
||||||
|
else:
|
||||||
|
install_requires = install_requires + tensorflow_pypi_dep
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='deepspeech_training',
|
name='deepspeech_training',
|
||||||
version=version,
|
version=version,
|
||||||
|
Loading…
Reference in New Issue
Block a user