diff --git a/docker/transformers-all-latest-gpu/Dockerfile b/docker/transformers-all-latest-gpu/Dockerfile index 4db6f51826f02b..502c9a61fd6c4a 100644 --- a/docker/transformers-all-latest-gpu/Dockerfile +++ b/docker/transformers-all-latest-gpu/Dockerfile @@ -32,7 +32,7 @@ RUN echo torch=$VERSION # TODO: We might need to specify proper versions that work with a specific torch version (especially for past CI). RUN [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA -RUN python3 -m pip install --no-cache-dir -U tensorflow +RUN python3 -m pip install --no-cache-dir -U tensorflow==2.9.1 RUN python3 -m pip uninstall -y flax jax # Use installed torch version for `torch-scatter` to avid to deal with PYTORCH='pre'. diff --git a/docker/transformers-cpu/Dockerfile b/docker/transformers-cpu/Dockerfile index c3590e4239e470..75a4f20a3b18fd 100644 --- a/docker/transformers-cpu/Dockerfile +++ b/docker/transformers-cpu/Dockerfile @@ -15,7 +15,7 @@ RUN apt update && \ RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ jupyter \ - tensorflow-cpu \ + tensorflow-cpu==2.9.1 \ torch WORKDIR /workspace @@ -23,4 +23,4 @@ COPY . transformers/ RUN cd transformers/ && \ python3 -m pip install --no-cache-dir . -CMD ["/bin/bash"] +CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/transformers-gpu/Dockerfile b/docker/transformers-gpu/Dockerfile index 0212eaa2a72b26..fc5c818438ba25 100644 --- a/docker/transformers-gpu/Dockerfile +++ b/docker/transformers-gpu/Dockerfile @@ -15,7 +15,7 @@ RUN apt update && \ RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ jupyter \ - tensorflow \ + tensorflow==2.9.1 \ torch RUN git clone https://github.com/NVIDIA/apex diff --git a/docker/transformers-tensorflow-cpu/Dockerfile b/docker/transformers-tensorflow-cpu/Dockerfile index ef3dc3d212cbbc..dbc81acbbb25a4 100644 --- a/docker/transformers-tensorflow-cpu/Dockerfile +++ b/docker/transformers-tensorflow-cpu/Dockerfile @@ -15,11 +15,11 @@ RUN apt update && \ RUN python3 -m pip install --no-cache-dir --upgrade pip && \ python3 -m pip install --no-cache-dir \ mkl \ - tensorflow-cpu + tensorflow-cpu==2.9.1 WORKDIR /workspace COPY . transformers/ RUN cd transformers/ && \ python3 -m pip install --no-cache-dir . -CMD ["/bin/bash"] +CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/transformers-tensorflow-gpu/Dockerfile b/docker/transformers-tensorflow-gpu/Dockerfile index a05ace7d08e268..a24faad8f2fcfb 100644 --- a/docker/transformers-tensorflow-gpu/Dockerfile +++ b/docker/transformers-tensorflow-gpu/Dockerfile @@ -12,7 +12,7 @@ RUN git clone https://github.com/huggingface/transformers && cd transformers && RUN python3 -m pip install --no-cache-dir -e ./transformers[dev-tensorflow,testing] # If set to nothing, will install the latest version -ARG TENSORFLOW='' +ARG TENSORFLOW='2.9.1' RUN [ ${#TENSORFLOW} -gt 0 ] && VERSION='tensorflow=='$TENSORFLOW'.*' || VERSION='tensorflow'; python3 -m pip install --no-cache-dir -U $VERSION RUN python3 -m pip uninstall -y torch flax diff --git a/setup.py b/setup.py index 3145272ef6f061..3aa0a86a4f607e 100644 --- a/setup.py +++ b/setup.py @@ -154,8 +154,8 @@ "sigopt", "librosa", "starlette", - "tensorflow-cpu>=2.3", - "tensorflow>=2.3", + "tensorflow-cpu>=2.3,<2.10", + "tensorflow>=2.3,<2.10", "tensorflow-text", "tf2onnx", "timeout-decorator", diff --git a/src/transformers/dependency_versions_table.py b/src/transformers/dependency_versions_table.py index 434b87048405f6..58e4a2cd42c372 100644 --- a/src/transformers/dependency_versions_table.py +++ b/src/transformers/dependency_versions_table.py @@ -60,8 +60,8 @@ "sigopt": "sigopt", "librosa": "librosa", "starlette": "starlette", - "tensorflow-cpu": "tensorflow-cpu>=2.3", - "tensorflow": "tensorflow>=2.3", + "tensorflow-cpu": "tensorflow-cpu>=2.3,<2.10", + "tensorflow": "tensorflow>=2.3,<2.10", "tensorflow-text": "tensorflow-text", "tf2onnx": "tf2onnx", "timeout-decorator": "timeout-decorator",