# DNN multi-target regression

**URL:** <https://root-forum.cern.ch/t/dnn-multi-target-regression/24724>\
**Category:** TMVA\
**Created:** [May 11, 2017, 8:47am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724 "2017-05-11T08:47:54Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwojtas](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mwojtas](https://root-forum.cern.ch/u/mwojtas)\
**Post date:** [May 11, 2017, 8:47am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/1 "2017-05-11T08:47:54Z")

</div>

Dear rooters,

I have a quick question about DNN implementation. Previously, I was using it for multi-target regression with root v6.07 and it worked just fine. Recently I updated to 6.08 (6.07 became unavailable on cern computers) and it seems it doesnt support the multi-target regression anymore. When i try to run the 6.08 regression tutorial with 2 targets it returns “Error in TRint::HandleTermInput(): std::out\_of\_range caught: vector::\_M\_range\_check” when it’s just about to start training. Is there any way to complete the training with DNN or is there any chance it will be fixed in the nearest future?

Cheers,  
Maks

---

<div class="post-metadata">

**Author:** ![mwojtas](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mwojtas](https://root-forum.cern.ch/u/mwojtas)\
**Post date:** [May 11, 2017, 12:24pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/2 "2017-05-11T12:24:09Z")

</div>

Update: I’ve just run multiclass tutorial ( [https://root.cern.ch/doc/v608/TMVAMulticlass\_8C.html](https://root.cern.ch/doc/v608/TMVAMulticlass_8C.html) ) for root version 6.08 and the same error pops up although DNN is supposed to work. Can anybody check if it doesn’t work for them as well?

Cheers,  
Maks

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [May 11, 2017, 6:38pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/3 "2017-05-11T18:38:27Z")

</div>

What version of the DNN are you using (Standard, CPU or GPU)? There is a problem in the standard implementation and multi-target classification/regression. If you are not already, could you try with either the CPU implementation?

In file copy TMVAMulticlass.C somewhere so you can change it and edit `nnOptions` on line 143; Change `Architecture=STANDARD` to `CPU`.

---

<div class="post-metadata">

**Author:** ![mwojtas](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mwojtas](https://root-forum.cern.ch/u/mwojtas)\
**Post date:** [May 11, 2017, 8:04pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/4 "2017-05-11T20:04:04Z")

</div>

Hello,  
Thanks for the answer.  
I am using standard implementation - I wanted to try CPU or GPU before but there is another error popping up: “Multi-core CPU backend not enabled. Please make sure you have a BLAS implementation and it was successfully detected by CMake as well that the imt CMake flag is set”. I am using root built in version (6.08/06)for lxplus7, so if you know how to make it work for that setup I could try and change it.

Cheers,  
Maks

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [May 15, 2017, 2:15pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/5 "2017-05-15T14:15:07Z")

</div>

Hi,

You are correct, it seems the root installation of lxplus7 is not built with support for the BLAS library (thus it is not possible to run the DNN with architecture=CPU).

What you could do is build your own version of ROOT using these instructions: [https://root.cern.ch/building-root](https://root.cern.ch/building-root)

Make sure that the blas library is installed and use `cmake ./path/to/root -Dimt=true` to use implicit multithreading which in turn enables DNN-CPU. (The libraries should be installed on lxplus7 so perhaps it is possible to build it there.)

---

<div class="post-metadata">

**Author:** ![mato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mato/32/12317_2.png) [@mato](https://root-forum.cern.ch/u/mato)\
**Post date:** [May 15, 2017, 8:21pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/6 "2017-05-15T20:21:28Z")

</div>

There are two installations of ROOT for lxplus7:

- A standalone version in `/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.08.06/x86_64-centos7-gcc48-opt` that uses the native compiler and does not assume much on system packages. This is perhaps the reason it does not use BLAS.
- A version as part of the LCG software stack. This is setup like this:  
`source /cvmfs/sft.cern.ch/lcg/views/LCG_88/x86_64-centos7-gcc62-opt/setup.sh`  
The stack contains BLAS but unfortunately the ROOT build was not configured to use it. I’ll fix this issue for future builds.  
Bottomline: non of the two builds are correct and will be fixed.

---

<div class="post-metadata">

**Author:** ![Danny\_Lee](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/45deac/32.png) [@Danny\_Lee](https://root-forum.cern.ch/u/Danny_Lee)\
**Post date:** [June 19, 2017, 5:07am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/7 "2017-06-19T05:07:57Z")

</div>

Hi, I am also having similar problem when trying test dnn in root6.10 on CentOS. It looks like the standard option is now gone with dnn\_cpu and dnn\_gpu left. I already have blas installed but cmake cannot seem to find. I try to find blas manually, but only doc of it.

---

<div class="post-metadata">

**Author:** ![mato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mato/32/12317_2.png) [@mato](https://root-forum.cern.ch/u/mato)\
**Post date:** [June 19, 2017, 10:09am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/8 "2017-06-19T10:09:21Z")

</div>

We are about to release a LCG stack including ROOT 6.10 in the next few days. Meanwhile you can give a try to the ‘nightlies’ like this on a centos7 system:

```auto
source /cvmfs/sft.cern.ch/lcg/views/dev3/latest/x86_64-centos7-gcc62-opt/setup.sh
root.exe -q $ROOTSYS/tutorials/tmva/TMVAMulticlass.C

```

---

<div class="post-metadata">

**Author:** ![nsonmez1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nsonmez1/32/37609_2.png) [@nsonmez1](https://root-forum.cern.ch/u/nsonmez1)\
**Post date:** [July 30, 2017, 2:31pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/9 "2017-07-30T14:31:29Z")

</div>

Hi, i am having the same error as BLAS library is not available. Unfortunately, i couldn’t find a flag in the documentation of the root installation. I guess if it is available in the standard directory such as /usr/lib64 cmake picks it up. I don’t have root access to the OS, so how could i give the direction where to look for BLAS library so that cmake will detect it.

---

<div class="post-metadata">

**Author:** ![mato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mato/32/12317_2.png) [@mato](https://root-forum.cern.ch/u/mato)\
**Post date:** [July 31, 2017, 6:46am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/10 "2017-07-31T06:46:55Z")

</div>

To find BLAS we use the CMake standard module FindBLAS.cmake. If BLAS is installed in your system it should find it. See for example what are the values of the variables BLAS\_XXXX in the CMake cache. You can use `ccmake .` command, and type `t` to see all the advanced variables.

---

<div class="post-metadata">

**Author:** ![nsonmez1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nsonmez1/32/37609_2.png) [@nsonmez1](https://root-forum.cern.ch/u/nsonmez1)\
**Post date:** [July 31, 2017, 8:25am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/11 "2017-07-31T08:25:47Z")

</div>

> [@mato](#):
>
> To find BLAS we use the CMake standard module FindBLAS.cmake. If BLAS is installed in your system it should find it. See for example what are the values of the variables BLAS\_XXXX in the CMake cache. You can use ccmake . command, and type t to see all the advanced variables.

Woaww i didn’t know anything about **ccmake .** now i can see all the advanced variables. Ok i can see all the BLAS related variables as well. I have installed OpenBlas library and therei see a flag named BLAS\_openblas\_LIBRARY, let me see what i can do with that. Thank you for reply.

---

<div class="post-metadata">

**Author:** ![jonesc](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonesc/32/20983_2.png) [@jonesc](https://root-forum.cern.ch/u/jonesc)\
**Post date:** [March 3, 2018, 5:46pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/12 "2018-03-03T17:46:05Z")

</div>

Sorry to return to this issue, but was the issue with he LCG ROOT releases not being built against BLAS ever resolved ? I ask as I am using ROOT 6.12 from the LCG 92 release

> which root  
> /cvmfs/sft.cern.ch/lcg/releases/LCG\_92/ROOT/6.12.04/x86\_64-slc6-gcc7-opt/bin/root

and I am also getting the same error message as started this thread

: Multi-core CPU backend not enabled. Please make sure you have a BLAS implementation and it was successfully detected by CMake as well that the imt CMake flag is set.

Chris

---

<div class="post-metadata">

**Author:** ![Hai\_Jiang1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/e99b99/32.png) [@Hai\_Jiang1](https://root-forum.cern.ch/u/Hai_Jiang1)\
**Post date:** [June 24, 2018, 6:25am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/13 "2018-06-24T06:25:27Z")

</div>

Actually I also met this issue:

> : Multi-core CPU backend not enabled. Please make sure you have a BLAS implementation and it was successfully detected by CMake as well that the imt CMake flag is set.

Anyone know where to find the guidance on how to install the BLAS and CMake to be compatible with the DNN in TMVA?

Many thanks!  
Hai

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [June 26, 2018, 11:52am UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/14 "2018-06-26T11:52:05Z")

</div>

Hi,

For a BLAS installation, you should be able to find an appropriate version in your linux distribution, or through e.g. homebrew or, fink, etc on mac. As long as BLAS is properly installed it should be picked up by the cmake configuration.

For ROOT `imt` is by default on since a few releases, so this should not be a problem.

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![Hai\_Jiang1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/e99b99/32.png) [@Hai\_Jiang1](https://root-forum.cern.ch/u/Hai_Jiang1)\
**Post date:** [June 26, 2018, 2:17pm UTC](https://root-forum.cern.ch/t/dnn-multi-target-regression/24724/15 "2018-06-26T14:17:06Z")

</div>

Dear Kim,

Thanks for the help! I will try to install them correctly.

Best,  
Hai
