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
[TMVA] Add support for tf.keras in MethodPyKeras #6568
Conversation
Starting build on |
Build failed on ROOT-ubuntu16/nortcxxmod. Failing tests: |
Build failed on mac1015/cxx17. Failing tests: |
Build failed on windows10/cxx14. Failing tests: |
The support is provided by adding an option in MethodPyKeras, tf.keras=1
Move from Init() to SetUpModel() when class state is filled either with options or with XML file Add a check if Keras version is >=2.3 If it is not and Tensorflow 2 is used then switch automatically to use Tensorflow.Keras
1b7cb55
to
1496a4f
Compare
Starting build on |
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.
Thanks! I think there are some minor issues in the logic. Could you have a look?
auto ret = PyRun_String("import keras", Py_single_input, fGlobalNS, fLocalNS); | ||
// need importing also in global namespace | ||
if (ret != nullptr) ret = PyRun_String("import keras", Py_single_input, fGlobalNS, fGlobalNS); | ||
if (ret != nullptr) |
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.
Here you have two times if(ret != nullptr)
, you can merge them.
tmva/pymva/src/MethodPyKeras.cxx
Outdated
void MethodPyKeras::Init() { | ||
|
||
std::cout << "Init MethodPyKeras " << std::endl; |
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.
Please remove this plain cout
print or use the TMVA logger
Starting build on |
Build failed on windows10/cxx14. Errors:
|
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!
Add support in MethodPyKeras for the Keras version shipped with tensorflow 2 (tf.keras).
At the moment default is still using keras with tensorflow backend
tf.keras=True
.