Skip to content

Commit 6050d0d

Browse files
authored
Try to make tf 2.18 on tpu vm install reliably (#1469)
I'm seeing it randomly pick the CUDA enabled version for some reason. Trying a force reinstall while maintaining existing packages to see if that helps.
1 parent e47c7ef commit 6050d0d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tpu/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ RUN export PATH="${HOME}/.local/bin:${PATH}" && uv pip install --system -r /requ
6666
/tmp/clean-layer.sh
6767
ENV PATH="~/.local/bin:${PATH}"
6868

69+
# Try to force tensorflow to reliably install without breaking other installed deps
70+
RUN export PATH="${HOME}/.local/bin:${PATH}" && \
71+
uv pip freeze --system > /tmp/constraints.txt && \
72+
uv pip install --system -c /tmp/constraints.txt tensorflow-tpu -f https://storage.googleapis.com/libtpu-tf-releases/index.html --force-reinstall && \
73+
rm /tmp/constraints.txt
74+
6975
# Kaggle Model Hub patches:
7076
ADD patches/kaggle_module_resolver.py /usr/local/lib/${PYTHON_VERSION_PATH}/site-packages/tensorflow_hub/kaggle_module_resolver.py
7177
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

0 commit comments

Comments
 (0)