adityas129 commited on
Commit
2f0ecf2
·
verified ·
1 Parent(s): 41cac3f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -11
Dockerfile CHANGED
@@ -58,19 +58,22 @@ RUN ln -sf /usr/bin/python3.11 /usr/bin/python && python -m pip install --upgrad
58
  # 1) Install JAX first
59
  RUN python -m pip install "jax[cuda12]==0.7.1" "jaxlib==0.7.1"
60
 
61
- # 2) Install seqio dependencies manually (excluding tfds-nightly to avoid protobuf conflict)
62
  RUN python -m pip install \
63
  absl-py clu sentencepiece
64
 
65
  # 3) Install seqio without dependencies
66
  RUN python -m pip install --no-deps "seqio==0.0.11"
67
 
68
- # 4) Install correct protobuf version for tf-nightly
69
- RUN python -m pip install "protobuf>=6.31.1,<8.0.0"
70
 
71
- # 5) Install TensorFlow nightly without dependencies (to avoid protobuf downgrade)
 
 
 
72
  RUN python -m pip install --no-deps \
73
- "tf-nightly" \
74
  "tensorflow-hub==0.16.1"
75
 
76
  # 6) Install remaining packages (consolidated, no duplicates)
@@ -92,13 +95,12 @@ RUN python -m pip install --no-deps \
92
  RUN python -m pip install --no-deps \
93
  'git+https://github.com/magenta/magenta-realtime#egg=magenta_rt[gpu]'
94
 
95
- # 10) Remove conflicting TensorFlow, then upgrade to latest
96
- RUN python -m pip uninstall -y tensorflow tensorflow-io-gcs-filesystem && \
97
- python -m pip install --upgrade --force-reinstall tf-nightly
98
-
99
 
100
- # Also upgrade JAX to latest to ensure XLA compatibility
101
- RUN python -m pip install --upgrade "jax[cuda12]" jaxlib
 
102
 
103
  # 11) Verify TensorFlow installation
104
  RUN python -c "import tensorflow as tf; print('='*50); print('TensorFlow version:', tf.__version__); print('='*50)"
 
58
  # 1) Install JAX first
59
  RUN python -m pip install "jax[cuda12]==0.7.1" "jaxlib==0.7.1"
60
 
61
+ # 2) Install seqio dependencies manually (excluding tfds-nightly and tensorflow-text)
62
  RUN python -m pip install \
63
  absl-py clu sentencepiece
64
 
65
  # 3) Install seqio without dependencies
66
  RUN python -m pip install --no-deps "seqio==0.0.11"
67
 
68
+ # 4) Comment out tensorflow-text import in seqio since it's not used by Magenta RT
69
+ RUN sed -i '/import tensorflow_text as tf_text/d' /usr/local/lib/python3.11/dist-packages/seqio/vocabularies.py
70
 
71
+ # 5) Install correct protobuf version for stable TensorFlow
72
+ RUN python -m pip install "protobuf>=3.20.3,<6.0.0"
73
+
74
+ # 6) Install stable TensorFlow (not nightly)
75
  RUN python -m pip install --no-deps \
76
+ "tensorflow[and-cuda]>=2.18.0" \
77
  "tensorflow-hub==0.16.1"
78
 
79
  # 6) Install remaining packages (consolidated, no duplicates)
 
95
  RUN python -m pip install --no-deps \
96
  'git+https://github.com/magenta/magenta-realtime#egg=magenta_rt[gpu]'
97
 
98
+ # 10) Remove conflicting stable tensorflow packages
99
+ RUN python -m pip uninstall -y tensorflow tensorflow-cpu tensorflow-text || true
 
 
100
 
101
+ # Install stable TensorFlow instead of nightly (following KEHANG's recommendation)
102
+ RUN python -m pip install --upgrade \
103
+ "tensorflow[and-cuda]>=2.18.0"
104
 
105
  # 11) Verify TensorFlow installation
106
  RUN python -c "import tensorflow as tf; print('='*50); print('TensorFlow version:', tf.__version__); print('='*50)"