# Loading model\_cnn.h5 model failured in TMVA

**URL:** <https://root-forum.cern.ch/t/loading-model-cnn-h5-model-failured-in-tmva/34032>\
**Category:** TMVA\
**Created:** [May 13, 2019, 6:42am UTC](https://root-forum.cern.ch/t/loading-model-cnn-h5-model-failured-in-tmva/34032 "2019-05-13T06:42:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sciencetruth991](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sciencetruth991/32/18427_2.png) [@sciencetruth991](https://root-forum.cern.ch/u/sciencetruth991)\
**Post date:** [May 13, 2019, 6:42am UTC](https://root-forum.cern.ch/t/loading-model-cnn-h5-model-failured-in-tmva/34032/1 "2019-05-13T06:42:30Z")

</div>

I book a CNN method,  
factory.BookMethod(&loader, TMVA::Types::kPyKeras,  
“PyKeras”,“H:!V:VarTransform=None:FilenameModel=model\_cnn.h5:”  
“FilenameTrainedModel=trained\_model\_cnn.h5:NumEpochs=20:BatchSize=256”);

but it failured with below mistake. I have used,  
// for using Keras  
gSystem-\>Setenv(“KERAS\_BACKEND”,“tensorflow”);  
TMVA::PyMethodBase::PyInitialize();

please give me a favour.Thank you very much

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/7/0/707b161886e2f1d62990eace96177a384969fc49.png)

---

<div class="post-metadata">

**Author:** ![swunsch](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/50afbb/32.png) [@swunsch](https://root-forum.cern.ch/u/swunsch)\
**Post date:** [May 14, 2019, 1:53pm UTC](https://root-forum.cern.ch/t/loading-model-cnn-h5-model-failured-in-tmva/34032/2 "2019-05-14T13:53:24Z")

</div>

Hi!

First observation: The error tells you that there is `No such file or directory`. So probably your path is wrong?  
Second problem: The interface does not support CNNs. Or it does support it as long as the inputs are “one-dimensional” in a sense that the input numpy array would be of rank 2 (batch size x number of variables).

Best  
Stefan

---

<div class="post-metadata">

**Author:** ![sciencetruth991](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sciencetruth991/32/18427_2.png) [@sciencetruth991](https://root-forum.cern.ch/u/sciencetruth991)\
**Post date:** [May 15, 2019, 7:02am UTC](https://root-forum.cern.ch/t/loading-model-cnn-h5-model-failured-in-tmva/34032/3 "2019-05-15T07:02:35Z")

</div>

Hi Stefan, I get it, thanks.
