# Error about TMVA

**URL:** <https://root-forum.cern.ch/t/error-about-tmva/64739>\
**Category:** TMVA\
**Created:** [March 7, 2026, 6:16am UTC](https://root-forum.cern.ch/t/error-about-tmva/64739 "2026-03-07T06:16:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [March 7, 2026, 6:16am UTC](https://root-forum.cern.ch/t/error-about-tmva/64739/1 "2026-03-07T06:16:28Z")

</div>

* * *

_The TMVA library is used for_ **artificial neural network，the train file is:**

_ROOT Version:_ 6.28/04  
_Platform:_ Ubuntu 20.04  
_Compiler:_ gcc 9.4.0

* * *

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [March 7, 2026, 6:21am UTC](https://root-forum.cern.ch/t/error-about-tmva/64739/2 "2026-03-07T06:21:16Z")

</div>

**the train file is:**

[train.cpp](https://root-forum.cern.ch/uploads/short-url/sujjl8GZDBtAIOdxfjx5BYUeP4Y.cpp) (3.5 KB)

and the file include the network parameters was produced, and used by the file for predicting.

and the predict file is:

[predict.cpp](https://root-forum.cern.ch/uploads/short-url/mfhpCTIrA0737PVJldL5XWzbBOE.cpp) (1.5 KB)

when running the predicting, the error occured:

```auto
     : Booking "DNN" of type "DNN" from dataset/weights/NeutronSpectrum_DNN.weights.xml.

```

```
             : MethodDNN is deprecated and it will be removed in future ROOT version. Please use MethodDL ( TMVA::kDL)

```

: Reading weight file: dataset/weights/NeutronSpectrum\_DNN.weights.xml

 DataSetInfo : [Default] : Added class "Regression" : Booked classifier "DNN" of type: "DNN" : Rebuilding Dataset Default Error in : matrices not compatible Prediction: spec0 = 15.692

what cause the error “matrices not compatible“?

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [March 9, 2026, 8:17am UTC](https://root-forum.cern.ch/t/error-about-tmva/64739/3 "2026-03-09T08:17:15Z")

</div>

@moneta, could you have a look here?

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 9, 2026, 3:37pm UTC](https://root-forum.cern.ch/t/error-about-tmva/64739/4 "2026-03-09T15:37:08Z")

</div>

Hi,

kDNN is a deprecated method and should not ne used. You should use `TMVA::Types::kDL` and see as example the tutorial TMVA\_Higgs\_Classification.C .

If you have issues converting the code to use kDL, please let me know

Lorenzo

---

<div class="post-metadata">

**Author:** ![newconcept1979](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/newconcept1979/32/26349_2.png) [@newconcept1979](https://root-forum.cern.ch/u/newconcept1979)\
**Post date:** [March 11, 2026, 12:51am UTC](https://root-forum.cern.ch/t/error-about-tmva/64739/5 "2026-03-11T00:51:13Z")

</div>

@moneta @StephanH , thanks, you are right, the application can run well.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 25, 2026, 12:52am UTC](https://root-forum.cern.ch/t/error-about-tmva/64739/6 "2026-03-25T00:52:04Z")

</div>

Closed on March 25, 2026, 12:52am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
