Dear TMVA experts,
I installed the latest version of the ROOT and python. I need to run the python project with Keras API. However, the following crash had happened while I tried to run my python script:
File “keras0_Binary.py”, line 22, in
AttributeError: <namespace cppyy.gbl.TMVA at 0x7ff6c1e6d630> has no attribute ‘PyMethodBase’. Full details:
type object ‘TMVA’ has no attribute ‘PyMethodBase’
‘TMVA::PyMethodBase’ is not a known C++ class
‘PyMethodBase’ is not a known C++ template
‘PyMethodBase’ is not a known C++ enum
I’ve installed all the packages like NumPy, SciPy, etc., and build the ROOT with a flag pointing to the python executables.
I’m a beginner in the field of ML application in HEP, any tips and help would be highly appreciated.
Welcome to the ROOT Forum! Maybe @moneta can help you
Sorry for the late reply. It looks like you have built ROOT without support for pymva. Can you try configuring with
cmake . -Dtmva-pymva=On and check in the log if all Python and bumpy packages are correctly found.
I’ve tried cmake . -Dtmva-pymva=On and got the following message in the log:
TMVA: Numpy or Python development package not found for python /usr/bin/python3. Switching off tmva-pymva option
I’m confused since I installed these packages even using conda to allow system to find all the required packages easily. (If I’m correct at that point).
Any suggestions? Thank you!
Ubuntu 18, 20:
sudo apt-get install python3-numpy python3-dev
CentOS 7 (needs enabled “epel” repository):
sudo yum install python3-numpy python3-devel