Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ on: [workflow_dispatch, push, pull_request]

jobs:
build_gcc:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@main
- name: Setup
run: |
# system libs
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
# python libs
sudo pip3 install --upgrade pip
sudo pip3 install numpy scipy h5py "tensorflow==2.18.0" "keras==3.8.0"
sudo pip3 install --break-system-packages --ignore-installed numpy scipy h5py "tensorflow==2.21.0" "keras==3.14.0"
echo "Python version:"
python3 --version
echo "Version numbers of TensorFlow and Keras:"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ Requirements and Installation

- 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
- Python 3.9 or higher
- TensorFlow 2.18.0
- Keras 3.8.0
- TensorFlow 2.21.0
- Keras 3.14.0

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

Expand Down
10 changes: 8 additions & 2 deletions include/fdeep/import_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,14 @@ namespace internal {
const get_param_f&, const nlohmann::json& data,
const std::string& name)
{
float_type threshold = data["config"]["threshold_value"];
float_type default_value = data["config"]["value"];
// Keras renamed these config keys: threshold_value -> threshold, value -> default_value.
const auto& config = data["config"];
float_type threshold = json_obj_has_member(config, "threshold")
? static_cast<float_type>(config["threshold"])
: static_cast<float_type>(config["threshold_value"]);
float_type default_value = json_obj_has_member(config, "default_value")
? static_cast<float_type>(config["default_value"])
: static_cast<float_type>(config["value"]);
return std::make_shared<threshold_layer>(name, threshold, default_value);
}

Expand Down
11 changes: 6 additions & 5 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ FROM ubuntu:24.04
RUN apt-get update -y --fix-missing
ENV DEBIAN_FRONTEND=noninteractive
RUN TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -y build-essential apt-utils cmake python3 python3-pip git llvm-17 clang-17 apt-transport-https curl gnupg patchelf
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

RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
RUN mv bazel-archive-keyring.gpg /usr/share/keyrings
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
RUN apt-get update -y && apt-get install -y bazel-6.5.0
RUN ln -s /usr/bin/bazel-6.5.0 /usr/bin/bazel
RUN apt-get update -y && apt-get install -y bazel-7.7.0
RUN ln -s /usr/bin/bazel-7.7.0 /usr/bin/bazel

RUN git clone -b 'v2.18.0' --single-branch --depth 1 https://github.com/tensorflow/tensorflow.git
RUN git clone -b 'v2.21.0' --single-branch --depth 1 https://github.com/tensorflow/tensorflow.git
WORKDIR /tensorflow
RUN ./configure
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
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
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
RUN pip install --break-system-packages "keras==3.14.0"
WORKDIR /

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
Expand Down