FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use optimized tensorflow wheels · RTDataScience/docker-python@99d9441 · GitHub

Commit 99d9441

Browse files
committed
Use optimized tensorflow wheels
1 parent a3e0529 commit 99d9441

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎Dockerfile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ RUN pip install seaborn python-dateutil dask && \
5151
make -j $(nproc) && make install && \
5252
/tmp/clean-layer.sh
5353

54-
RUN pip install tensorflow==2.0.0rc1 && \
54+
# Install tensorflow from a pre-built wheel
55+
COPY --from=tensorflow_whl /tmp/tensorflow_cpu/*.whl /tmp/tensorflow_cpu/
56+
RUN pip install /tmp/tensorflow_cpu/tensorflow*.whl && \
57+
rm -rf /tmp/tensorflow_cpu && \
5558
/tmp/clean-layer.sh
5659

5760
RUN apt-get install -y libfreetype6-dev && \

‎gpu.Dockerfile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG BASE_TAG=staging
22

33
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 AS nvidia
4+
FROM gcr.io/kaggle-images/python-tensorflow-whl:2.0.0-rc1-py36 as tensorflow_whl
45
FROM gcr.io/kaggle-images/python:${BASE_TAG}
56

67
ADD clean-layer.sh /tmp/clean-layer.sh
@@ -44,8 +45,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4445
/tmp/clean-layer.sh
4546

4647
# Reinstall packages with a separate version for GPU support.
48+
COPY --from=tensorflow_whl /tmp/tensorflow_gpu/*.whl /tmp/tensorflow_gpu/
4749
RUN pip uninstall -y tensorflow && \
48-
pip install tensorflow-gpu==2.0.0rc1 && \
50+
pip install /tmp/tensorflow_gpu/tensorflow*.whl && \
4951
rm -rf /tmp/tensorflow_gpu && \
5052
conda remove --force -y pytorch-cpu torchvision-cpu && \
5153
conda install -y pytorch torchvision cudatoolkit=10.0 -c pytorch && \

‎tests/test_tensorflow.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class TestTensorflow(unittest.TestCase):
1010
def test_addition(self):
11-
result = tf.add(2, 3)
11+
result = tf.add(2, 3)
1212
self.assertEqual(5, result.numpy())
1313

1414
def test_conv2d(self):

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL