Skip to content

Commit 3121339

Browse files
Dobiasdclaude
andauthored
Bump tested versions to TensorFlow 2.21.0 / Keras 3.14.0 (#464)
* Bump tested versions to TensorFlow 2.21.0 / Keras 3.14.0 Update CI pin and the README's documented tested versions, and accept the renamed Threshold layer config keys (threshold_value -> threshold, value -> default_value) so models exported from Keras 3.14 load. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Bump TensorFlow to 2.21.0 in the perf-test Dockerfile Also pin keras==3.14.0 explicitly so the perf-test image matches the versions pinned in CI rather than relying on whatever Keras the TensorFlow wheel happens to pull in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update perf-test Dockerfile to build TF 2.21 from source TF 2.21's .bazelrc uses --enable_workspace, which requires Bazel 7+, so bump the pinned bazel from 6.5.0 to 7.7.0 (matches TF 2.21's .bazelversion). Also install xxd, which TF's XLA genrules now invoke during the build. Verified by running docker build of test/Dockerfile end-to-end: TF wheel builds, save_application_examples.py converts all Keras Application models, applications_performance loads and benchmarks them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Bump CI runner image to ubuntu-24.04 keras==3.14.0 requires Python >=3.11; the ubuntu-22.04 runner ships Python 3.10. Use ubuntu-24.04 (Python 3.12) so pip can resolve the pinned version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add --break-system-packages to CI pip installs Ubuntu 24.04 ships a PEP 668 externally-managed Python where system-wide pip installs are blocked unless the flag is set, even from a sudo shell. Required after the runner bump. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Drop redundant pip self-upgrade in CI Ubuntu 24.04 ships pip 24.0, which already handles the TF 2.21 and Keras 3.14 wheels. The self-upgrade step also runs into PEP 668's RECORD-file check on apt-installed pip, so removing it both simplifies setup and avoids that quirk. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add --ignore-installed to CI pip install Some apt-shipped Python packages on the ubuntu-24.04 runner (e.g. python3-typing-extensions) lack RECORD files, so pip refuses to uninstall them when a newer version is needed. Tell pip to overlay the requested versions without uninstalling, mirroring how other CI runners on PEP 668 systems handle this. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9bf54fc commit 3121339

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ on: [workflow_dispatch, push, pull_request]
44

55
jobs:
66
build_gcc:
7-
runs-on: ubuntu-22.04
7+
runs-on: ubuntu-24.04
88
steps:
99
- uses: actions/checkout@main
1010
- name: Setup
1111
run: |
1212
# system libs
1313
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
1414
# python libs
15-
sudo pip3 install --upgrade pip
16-
sudo pip3 install numpy scipy h5py "tensorflow==2.18.0" "keras==3.8.0"
15+
sudo pip3 install --break-system-packages --ignore-installed numpy scipy h5py "tensorflow==2.21.0" "keras==3.14.0"
1716
echo "Python version:"
1817
python3 --version
1918
echo "Version numbers of TensorFlow and Keras:"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ Requirements and Installation
137137

138138
- A **C++14**-compatible compiler: Compilers from these versions on are fine: GCC 4.9, Clang 3.7 (libc++ 3.7) and Visual C++ 2015
139139
- Python 3.9 or higher
140-
- TensorFlow 2.18.0
141-
- Keras 3.8.0
140+
- TensorFlow 2.21.0
141+
- Keras 3.14.0
142142

143143
(These are the tested versions, but somewhat older ones might work too.)
144144

include/fdeep/import_model.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,8 +1037,14 @@ namespace internal {
10371037
const get_param_f&, const nlohmann::json& data,
10381038
const std::string& name)
10391039
{
1040-
float_type threshold = data["config"]["threshold_value"];
1041-
float_type default_value = data["config"]["value"];
1040+
// Keras renamed these config keys: threshold_value -> threshold, value -> default_value.
1041+
const auto& config = data["config"];
1042+
float_type threshold = json_obj_has_member(config, "threshold")
1043+
? static_cast<float_type>(config["threshold"])
1044+
: static_cast<float_type>(config["threshold_value"]);
1045+
float_type default_value = json_obj_has_member(config, "default_value")
1046+
? static_cast<float_type>(config["default_value"])
1047+
: static_cast<float_type>(config["value"]);
10421048
return std::make_shared<threshold_layer>(name, threshold, default_value);
10431049
}
10441050

test/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ FROM ubuntu:24.04
66
RUN apt-get update -y --fix-missing
77
ENV DEBIAN_FRONTEND=noninteractive
88
RUN TZ=Etc/UTC apt-get -y install tzdata
9-
RUN apt-get install -y build-essential apt-utils cmake python3 python3-pip git llvm-17 clang-17 apt-transport-https curl gnupg patchelf
9+
RUN apt-get install -y build-essential apt-utils cmake python3 python3-pip git llvm-17 clang-17 apt-transport-https curl gnupg patchelf xxd
1010

1111
RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
1212
RUN mv bazel-archive-keyring.gpg /usr/share/keyrings
1313
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
14-
RUN apt-get update -y && apt-get install -y bazel-6.5.0
15-
RUN ln -s /usr/bin/bazel-6.5.0 /usr/bin/bazel
14+
RUN apt-get update -y && apt-get install -y bazel-7.7.0
15+
RUN ln -s /usr/bin/bazel-7.7.0 /usr/bin/bazel
1616

17-
RUN git clone -b 'v2.18.0' --single-branch --depth 1 https://github.com/tensorflow/tensorflow.git
17+
RUN git clone -b 'v2.21.0' --single-branch --depth 1 https://github.com/tensorflow/tensorflow.git
1818
WORKDIR /tensorflow
1919
RUN ./configure
2020
RUN bazel build -c opt --copt=-march=native --jobs 16 --local_ram_resources=HOST_RAM*.3 -c opt //tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tensorflow_cpu
21-
RUN pip install --break-system-packages bazel-bin/tensorflow/tools/pip_package/wheel_house/tensorflow_cpu-2.18.0-cp312-cp312-linux_x86_64.whl
21+
RUN pip install --break-system-packages bazel-bin/tensorflow/tools/pip_package/wheel_house/tensorflow_cpu-2.21.0-cp312-cp312-linux_x86_64.whl
22+
RUN pip install --break-system-packages "keras==3.14.0"
2223
WORKDIR /
2324

2425
RUN git clone -b 'v0.2.24' --single-branch --depth 1 https://github.com/Dobiasd/FunctionalPlus && cd FunctionalPlus && mkdir -p build && cd build && cmake .. && make && make install

0 commit comments

Comments
 (0)