Skip to content

Commit 9fc103b

Browse files
committed
Upgrade to Tensorflow 2.11
http://b/268473381
1 parent 739e1b0 commit 9fc103b

File tree

2 files changed

+36
-35
lines changed

2 files changed

+36
-35
lines changed

Dockerfile.tmpl

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG TORCHVISION_VERSION
1010

1111
{{ if eq .Accelerator "gpu" }}
1212
FROM gcr.io/kaggle-images/python-lightgbm-whl:${GPU_BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}-${LIGHTGBM_VERSION} AS lightgbm_whl
13-
FROM gcr.io/kaggle-images/python-torch-whl:${GPU_BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}-${TORCH_VERSION} AS torch_whl
13+
#FROM gcr.io/kaggle-images/python-torch-whl:${GPU_BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}-${TORCH_VERSION} AS torch_whl
1414
FROM ${BASE_IMAGE_REPO}/${GPU_BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
1515
{{ else }}
1616
FROM ${BASE_IMAGE_REPO}/${CPU_BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
@@ -34,7 +34,7 @@ RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/lib
3434
{{ end }}
3535

3636
# Keep these variables in sync if base image is updated.
37-
ENV TENSORFLOW_VERSION=2.9.2
37+
ENV TENSORFLOW_VERSION=2.11.0
3838

3939
# We need to redefine the ARG here to get the ARG value defined above the FROM instruction.
4040
# See: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
@@ -93,11 +93,10 @@ RUN conda config --add channels nvidia && \
9393
{{ if eq .Accelerator "gpu" }}
9494

9595
# b/232247930: uninstall pyarrow to avoid double installation with the GPU specific version.
96-
# b/267180053: RapidsAI (cudf/cuml) are not compatible with the latest tensorflow cudatoolkit version.
97-
# RUN pip uninstall -y pyarrow && \
98-
# mamba install -y cudf cuml && \
99-
# /tmp/clean-layer.sh
100-
# {{ end }}
96+
RUN pip uninstall -y pyarrow && \
97+
mamba install -y cudf cuml && \
98+
/tmp/clean-layer.sh
99+
{{ end }}
101100

102101
# Install implicit
103102
{{ if eq .Accelerator "gpu" }}
@@ -110,17 +109,17 @@ RUN mamba install implicit && \
110109

111110
# Install PyTorch
112111
{{ if eq .Accelerator "gpu" }}
113-
COPY --from=torch_whl /tmp/whl/*.whl /tmp/torch/
112+
#COPY --from=torch_whl /tmp/whl/*.whl /tmp/torch/
114113
RUN mamba install -c pytorch magma-cuda${CUDA_MAJOR_VERSION}${CUDA_MINOR_VERSION} && \
115-
pip install /tmp/torch/*.whl && \
114+
#pip install /tmp/torch/*.whl && \
116115
# b/255757999 openmp (libomp.so) is an dependency of libtorchtext and libtorchaudio but
117116
# the built from source versions don't seem to properly link it in. This forces the dep
118117
# which makes sure that libomp is loaded when these libraries are loaded.
119-
mamba install -y openmp && \
120-
pip install patchelf && \
121-
patchelf --add-needed libomp.so /opt/conda/lib/python3.7/site-packages/torchtext/lib/libtorchtext.so && \
122-
patchelf --add-needed libomp.so /opt/conda/lib/python3.7/site-packages/torchaudio/lib/libtorchaudio.so && \
123-
rm -rf /tmp/torch && \
118+
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113 && \
119+
#pip install patchelf && \
120+
#patchelf --add-needed libomp.so /opt/conda/lib/python3.7/site-packages/torchtext/lib/libtorchtext.so && \
121+
#patchelf --add-needed libomp.so /opt/conda/lib/python3.7/site-packages/torchaudio/lib/libtorchaudio.so && \
122+
#rm -rf /tmp/torch && \
124123
/tmp/clean-layer.sh
125124
{{ else }}
126125
RUN pip install \
@@ -376,22 +375,24 @@ RUN pip install tensorpack && \
376375
/tmp/clean-layer.sh
377376

378377
# install cython & cysignals before pyfasttext
378+
RUN rm /opt/conda/lib/python3.7/site-packages/*/direct_url.json
379379
RUN pip install cython \
380380
cysignals \
381381
pyfasttext \
382382
fasttext && \
383-
apt-get install -y libhunspell-dev && pip install hunspell && \
384-
pip install annoy \
385-
category_encoders \
383+
apt-get install -y libhunspell-dev && pip install hunspell
384+
RUN pip install annoy \
385+
category_encoders && \
386+
# These should already be installed?
386387
# google-cloud-automl 2.0.0 introduced incompatible API changes, need to pin to 1.0.1
387-
google-cloud-automl==1.0.1 \
388-
google-api-core==1.33.2 \
389-
google-cloud-bigquery==2.2.0 \
390-
google-cloud-storage \
391-
google-cloud-translate==3.* \
392-
google-cloud-language==2.* \
393-
google-cloud-videointelligence==2.* \
394-
google-cloud-vision==2.* && \
388+
#google-cloud-automl==1.0.1 \
389+
#google-api-core==1.33.2 \
390+
#google-cloud-bigquery==2.2.0 \
391+
#google-cloud-storage \
392+
#google-cloud-translate==3.* \
393+
#google-cloud-language==2.* \
394+
#google-cloud-videointelligence==2.* \
395+
#google-cloud-vision==2.* && \
395396
# b/183041606#comment5: the Kaggle data proxy doesn't support these APIs. If the library is missing, it falls back to using a regular BigQuery query to fetch data.
396397
pip uninstall -y google-cloud-bigquery-storage && \
397398
# After launch this should be installed from pip
@@ -414,6 +415,7 @@ RUN pip install cython \
414415

415416

416417
# Fix qgrid by pinning ipywidgets https://github.com/quantopian/qgrid/issues/376
418+
# allennlp \
417419
RUN pip install bleach \
418420
certifi \
419421
cycler \
@@ -466,11 +468,10 @@ RUN pip install bleach \
466468
pyarrow \
467469
feather-format \
468470
fastai \
469-
allennlp \
470-
importlib-metadata && \
471-
python -m spacy download en_core_web_sm && python -m spacy download en_core_web_lg && \
472-
apt-get install -y ffmpeg && \
473-
/tmp/clean-layer.sh
471+
importlib-metadata
472+
#RUN python -m spacy download en_core_web_sm && python -m spacy download en_core_web_lg && \
473+
# apt-get install -y ffmpeg && \
474+
# /tmp/clean-layer.sh
474475

475476
###########
476477
#
@@ -495,7 +496,7 @@ RUN pip install flashtext \
495496
pympler \
496497
s3fs \
497498
featuretools \
498-
-e git+https://github.com/SohierDane/BigQuery_Helper#egg=bq_helper \
499+
#-e git+https://github.com/SohierDane/BigQuery_Helper#egg=bq_helper \
499500
hpsklearn \
500501
git+https://github.com/Kaggle/learntools \
501502
kmapper \
@@ -526,7 +527,7 @@ RUN pip install flashtext \
526527
pip install pytorch-ignite \
527528
qgrid \
528529
bqplot \
529-
earthengine-api \
530+
#earthengine-api \
530531
transformers \
531532
# b/232247930 >= 2.2.0 requires pyarrow >= 6.0.0 which conflicts with dependencies for rapidsai 0.21.*
532533
datasets==2.1.0 \

config.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
BASE_IMAGE_REPO=gcr.io/deeplearning-platform-release
2-
BASE_IMAGE_TAG=m96
3-
CPU_BASE_IMAGE_NAME=tf2-cpu.2-9
4-
GPU_BASE_IMAGE_NAME=tf2-gpu.2-9
2+
BASE_IMAGE_TAG=m103
3+
CPU_BASE_IMAGE_NAME=tf2-cpu.2-11
4+
GPU_BASE_IMAGE_NAME=tf2-gpu.2-11
55
LIGHTGBM_VERSION=3.3.2
66
TORCH_VERSION=1.12.0
77
TORCHAUDIO_VERSION=0.12.0

0 commit comments

Comments
 (0)