Skip to content

Commit c49354f

Browse files
committed
[tmva][pymva] Deprecate the PyKeras method
The new Keras 3 API broke the existing TMVA `PyKeras` method. Re-implementing the method for Keras 3 turned out to be difficult, as it is not possible anymore to disable eager execution and have a decent speed in evaluating the model for single events. So large-scale refactoring would be necessary to implement `PyKeras` again with good performance (see also #15790). Nowadays, we also have the RBatchGenerator to train Keras models directly with batches that are provided by ROOT. Therefore, the TMVA `PyKeras` method is not the only way anymore to train a Keras model with ROOT data without 3rd party libraries for the IO. That means it's not an essential feature anymore, and deprecating it will even make the situation clearer for the user, as there are not two different ways anymore to train Keras models on ROOT data.
1 parent 8283887 commit c49354f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

README/ReleaseNotes/v640/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The following people have contributed to this new version:
3838
* Comparing C++ `nullptr` objects with `None` in Python now raises a `TypeError`, as announced in the ROOT 6.38 release notes. Use truth-value checks like `if not x` or `x is None` instead.
3939
* The `TGLIncludes.h` and `TGLWSIncludes.h` that were deprecated in ROOT 6.38 and scheduled for removal are gone now. Please include your required headers like `<GL/gl.h>` or `<GL/glu.h>` directly.
4040
* The GLEW headers (`GL/eglew.h`, `GL/glew.h`, `GL/glxew.h`, and `GL/wglew.h`) that were installed when building ROOT with `builtin_glew=ON` are no longer installed. This is done because ROOT is moving away from GLEW for loading OpenGL extensions.
41+
* The TMVA `PyKeras` method is deprecated. It was broken by the API changes in Keras 3, released in November 2023 and part of TensorFlow 2.16 or newer. The `PyKeras` method will be removed in ROOT 6.42 (unless an updated implementation for Keras 3 that matches usage, performance and stability requirements will be found unexpectedly).
4142

4243
## Build System
4344

tmva/pymva/src/MethodPyKeras.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ void MethodPyKeras::InitKeras() {
182182
// initialize first Keras. This is done only here when class has
183183
// all state variable set from options or read from XML file
184184
// Import Keras
185+
Log() << kWARNING
186+
<< "The PyKeras TMVA method was deprecated in ROOT 6.40 and will be removed in ROOT 6.42, since it was broken "
187+
"by the API changes in Keras 3, released in November 2023 and part of TensorFlow 2.16 or newer."
188+
<< Endl;
185189

186190
if (fUseTFKeras)
187191
Log() << kINFO << "Setting up tf.keras" << Endl;

tmva/tmva/inc/TMVA/Types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ namespace TMVA {
100100
kPyRandomForest ,
101101
kPyAdaBoost ,
102102
kPyGTB ,
103-
kPyKeras ,
103+
kPyKeras, // deprecated, will be removed in ROOT 6.42
104104
kPyTorch ,
105105
kC50 ,
106106
kRSNNS ,

0 commit comments

Comments
 (0)