This macro run the SOFIE parser on the Keras model obtaining running TMVA_Higgs_Classification.C You need to run that macro before this one
Author: Lorenzo Moneta
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Wednesday, July 16, 2025 at 05:07 AM.
using namespace TMVA::Experimental;
Arguments are defined.
const char * modelFile = "Higgs_trained_model.h5";
check if the input file exists
if (gSystem->AccessPathName(modelFile)) {
Error("TMVA_SOFIE_RDataFrame","You need to run TMVA_Higgs_Classification.C to generate the Keras trained model");
return;
}
Error in <TMVA_SOFIE_RDataFrame>: You need to run TMVA_Higgs_Classification.C to generate the Keras trained model
parse the input Keras model into RModel object
SOFIE::RModel model = SOFIE::PyKeras::Parse(modelFile);
TString modelHeaderFile = modelFile;
modelHeaderFile.ReplaceAll(".h5",".hxx");
input_line_58:2:31: error: 'PyKeras' is not a class, namespace, or enumeration SOFIE::RModel model = SOFIE::PyKeras::Parse(modelFile); ^ input_line_58:2:31: note: 'PyKeras' declared here
Generating inference code
model.Generate();
model.OutputGenerated(std::string(modelHeaderFile));
input_line_60:2:3: error: use of undeclared identifier 'model' (model.Generate()) ^ Error in <HandleInterpreterException>: Error evaluating expression (model.Generate()) Execution of your code was aborted.
copy include in $ROOTSYS/tutorials
std::cout << "include is in " << gROOT->GetIncludeDir() << std::endl;
include is in /github/home/ROOT-CI/build/include/