From eecfb60fdb70af5d800406810753033038f55476 Mon Sep 17 00:00:00 2001 From: Dustin Herbison Date: Thu, 16 Jan 2025 16:37:30 +0000 Subject: [PATCH 1/2] try to make tf2.18 install for tpu vm reliable --- tpu/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tpu/Dockerfile b/tpu/Dockerfile index b1f81bbd..788d531f 100644 --- a/tpu/Dockerfile +++ b/tpu/Dockerfile @@ -66,6 +66,12 @@ RUN export PATH="${HOME}/.local/bin:${PATH}" && uv pip install --system -r /requ /tmp/clean-layer.sh ENV PATH="~/.local/bin:${PATH}" +# Try to force tensorflow to reliably install without breaking other installed deps +RUN export PATH="${HOME}/.local/bin:${PATH}" && \ + uv pip freeze --system > /tmp/constraints.txt && \ + uv pip install --system -c /tmp/constraints.txt tensorflow-tpu -f https://storage.googleapis.com/libtpu-tf-releases/index.html && \ + rm /tmp/constraints.txt + # Kaggle Model Hub patches: ADD patches/kaggle_module_resolver.py /usr/local/lib/${PYTHON_VERSION_PATH}/site-packages/tensorflow_hub/kaggle_module_resolver.py RUN sed -i '/from tensorflow_hub import uncompressed_module_resolver/a from tensorflow_hub import kaggle_module_resolver' /usr/local/lib/${PYTHON_VERSION_PATH}/site-packages/tensorflow_hub/config.py From 4b08ee4f2e396ab7b5eb9421a38228cb69d06d69 Mon Sep 17 00:00:00 2001 From: Dustin H Date: Fri, 17 Jan 2025 14:49:00 -0500 Subject: [PATCH 2/2] --force-reinstall --- tpu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpu/Dockerfile b/tpu/Dockerfile index 788d531f..923ad2d5 100644 --- a/tpu/Dockerfile +++ b/tpu/Dockerfile @@ -69,7 +69,7 @@ ENV PATH="~/.local/bin:${PATH}" # Try to force tensorflow to reliably install without breaking other installed deps RUN export PATH="${HOME}/.local/bin:${PATH}" && \ uv pip freeze --system > /tmp/constraints.txt && \ - uv pip install --system -c /tmp/constraints.txt tensorflow-tpu -f https://storage.googleapis.com/libtpu-tf-releases/index.html && \ + uv pip install --system -c /tmp/constraints.txt tensorflow-tpu -f https://storage.googleapis.com/libtpu-tf-releases/index.html --force-reinstall && \ rm /tmp/constraints.txt # Kaggle Model Hub patches: