How to set ResNet50 structure with cnn of TMVA

Structure of ResNet50 or ResNet152 is so powerful than the flat cnn, can someone give an example to use TMVA or other root code (better with c++) to set up the same cnn structure as ResNet? Thanks in advance!

Best Regards

@sitong @moneta can you help maybe?


The way this is currently supported in TMVA is through the generic keras interface. This means you have to set up you model with keras, save it to disk and load it through the TMVA PyKeras methods.

Please note that any problems you might encouter with external applications or code such as keras, tensorflow, and the linked git repositories and gists are unfortunately not covered in this forum.

A sketch in python, provided for reference, follows below. Adaption to c++ should be straightforward. You would still need to generate the keras model through python.

# Create directory structure
mkdir tmvaresnet
cd tmvaresnet

# Get stuff
git clone

# Run training
python tmva_mnist/

This is tested on my local machine with a recent check out from the development version. Your mileage might vary :slight_smile:

Note: I did not inspect the output of this script since it takes ages to run on my laptop. It seems to work as it is training and converging.

Links to the gists in clickable form: