Whenever I try to run
sayang@DESKTOP-IFS80HM:~/root_src/tutorials/tmva$ root TMVA_SOFIE_ONNX.C
its showing:
/home/sayang/root_src/tutorials/tmva/TMVA_SOFIE_ONNX.C:15:12: error: no type named ‘RModelParser_ONNX’ in namespace ‘TMVA::Experimental::SOFIE’
SOFIE::RModelParser_ONNX Parser;
Also in case of TMVA_SOFIE_Keras.C its showing :
Processing TMVA_SOFIE_Keras.C…
Traceback (most recent call last):
File “make_keras_model.py”, line 4, in
import numpy as np
ImportError: No module named numpy
terminate called after throwing an instance of ‘std::runtime_error’
what(): Model file KerasModel.h5 not found!
I have installed keras , numpy (pip install numpy),but its only happening with the tmva-sofie files. Although I have built root with(-Dtmva-sofie=on)Other tmva files are running fine. Thanks!
You need to have the support for tmva-sofie. It is not enough to do at configure time (-Dtmva-sofie=On), you need also to give a compatible protobuf version. For example in my case I configured root with:
Thanks , TMVA_SOFIE_ONNX.C is now running but TMVA_SOFIE_PyTorch.C and same with keras are still showing error, although I installed numpy(pip install numpy) and keras(pip install keras). My protobuf version is 3.6.1.
Hi,
It is possible that ROOT uses a different python version and it does not find Numpy. Do you see tmva-pymva in the list given by cmake when configuring ?
Yes, tmva-pymva is present in root-config --features, but I coudn’t find it while configuring
regarding python version, it showed the following during configuring…
Could NOT find Python2 (missing: Python2_NumPy_INCLUDE_DIRS NumPy) (found version “2.7.18”)
Ok, then ROOT is using probably python3. Do you have PyTorch installed for Python3 ?
What is the default Python in your system (when you type python --version ) ?
Processing TMVA_SOFIE_PyTorch.C…
Traceback (most recent call last):
File “make_pytorch_model.py”, line 1, in
import torch
ImportError: No module named torch
terminate called after throwing an instance of ‘std::runtime_error’
what(): Model file PyTorchModel.pt not found!
sayang@DESKTOP-IFS80HM:~/root_src/tutorials/dataframe$ python3
Python 3.8.10 (default, Jun 2 2021, 10:49:15)
[GCC 9.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import torch
print(torch.version)
1.10.2+cu102
sayang@DESKTOP-IFS80HM:~/root_src/tutorials/dataframe$ python
Python 2.7.18 (default, Mar 8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
import torch
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named torch
This is the problem, you have PyTorch installed only for python3. What you should do is to edit the script TMVA_SOFIE_PyTorch and TMVA_SOFIE_Keras and replace the line: