-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[tmva][pymva] Improve evaluations in pymva and add support for Keras3 (TF >= 2.16) #15790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Test Results 23 files 23 suites 3d 19h 12m 38s ⏱️ For more details on these failures, see this check. Results for commit 1414858. ♻️ This comment has been updated with latest results. |
584c49f to
6e3a9d9
Compare
|
Thanks for the PR. Is this code tested anywhere? |
dpiparo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
Hi @lmoneta, how should we proceed here? There is now TensorFlow 2.19 already, and the last TensorFlow we support is still the 2.15 release. I think the real question is: it it actually worth it to support inference with TensorFlow/Keras given the declining popularity of TensorFlow?
The list can go on. |
|
Also, maybe it makes sense to split the TensorFlow compatibility and the other commit with the general improvements into two separate PRs? Then we can already merge the other improvements, because they are covered by the CI. For the TensorFlow compatibility, we have once again the chicken-and-egg problem that it will only be covered once we allow TF>=2.16 in our |
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] #15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] #15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] #15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] #15790
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] #15790
This problem was resolved now by disabling |
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
This follows up on 3923ba5, where I forgot to change this. If a feature is not tested in the CI and included in the binaries, we should also not enable it by default when people build ROOT from source. Also, clarify the TensorFlow support status in the option description (see also root-project#15790).
Right now we don't support the newest TensorFlow releases after the 2.15 series, initially released in November 2023 [1]. Support for TensorFlow>=2.16 is worked on [2], but it's difficult to make progress if we don't have TensorFlow>=2.16 in our CI images. And we veto it from our CI image via the `requirements.txt` mechanism. To continue, we need to temporarily disable PyMVA in the CI, such that we can include the newest TensorFlow version in our images, and then re-enable it in the PR that fixes support for the newest TensorFlow. This is what is done in this commit. Supporting the newest TensorFlow became a bit more important now that we also have another feature besides PyMVA that uses TensorFlow: the RBatchGenerator. It would not good to hold off testing the actively-developed RBatchGenerator on newer TensorFlow versions, just because PyMVA prevents us from installing these on our CI. [1] https://github.com/tensorflow/tensorflow/releases [2] root-project#15790
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 root-project#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.
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 root-project#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.
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 root-project#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.
Add support for the new Keras API when using tensorflow 2.16 Note that with the new Keras one needs in pymva to use the ".keras" format instead of the ".h5" format
…ticlass on all dataset events Implement the new MethodBase functions GetAllRegressionValues and GetAllMultiClassValues for MethodPyKeras and MethodPyTorch. This speeds up the model testng and evaluation also for regression and multi-class problems. Fix also some memory issues with the Python objects used to keep the input/output values in the model evaluation. Remove timer logging in the pymva GetMultiClassValues functions. The logging is done anyway at the level of MethodBase Increase statistics and re-add the test on regression error in testPyKerasRegression
6e3a9d9 to
81ce66b
Compare
Do not use anymore .h5 files but .keras since .h5 is not anymore supported in keras3
1c1763f to
13b40ca
Compare
|
Hi, thanks for picking this up again! Could you put |
guitargeek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you very much! The test failures on alma10 are related to other PyMVA features and SOFIE, so for PyKeras it's all good 👍
2026-01-13T16:45:47.3921839Z TEST FAILURES:
2026-01-13T16:45:47.3922008Z 497:PyMVA-AdaBoost-Classification
2026-01-13T16:45:47.3922208Z 498:PyMVA-AdaBoost-Multiclass
2026-01-13T16:45:47.3922424Z 1442:tutorial-machine_learning-TMVA_SOFIE_RDataFrame-pyOnce the temporary test commit changing alma10.txt is removed, the PR is good to be merged!
the algorithm option is not anymore supported from scikit versions 1.6 Remove it in the MethodAdaBoost The SOFIE tutorials which require pymva need also a valid Keras parser, so exclude them if Keras is an unsupported version
3b0fe11 to
c3956bd
Compare
|
Looks like some of the PyMVA features don't work on ARM, which is shown on our Maybe it's fine for you to enable the PyMVA features on another platform, e.g. |
c3956bd to
1414858
Compare
This Pull request starts adding support for new TF version (2.16) coming with Keras3 API.
In addition, it improves the evaluation of models for regression and multi-class by using all events instead of the single event as before. With TF 2.16 s not possible anymore to disable eager execution and have a decent speed i evaluating the model