Skip to content

Commit abefac8

Browse files
Dobiasdclaude
andcommitted
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>
1 parent 9bf54fc commit abefac8

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
1414
# python libs
1515
sudo pip3 install --upgrade pip
16-
sudo pip3 install numpy scipy h5py "tensorflow==2.18.0" "keras==3.8.0"
16+
sudo pip3 install numpy scipy h5py "tensorflow==2.21.0" "keras==3.14.0"
1717
echo "Python version:"
1818
python3 --version
1919
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

0 commit comments

Comments
 (0)