# PyRandomForest TMVA::Reader crash

**URL:** <https://root-forum.cern.ch/t/pyrandomforest-tmva-reader-crash/25043>\
**Category:** TMVA\
**Created:** [June 7, 2017, 12:15pm UTC](https://root-forum.cern.ch/t/pyrandomforest-tmva-reader-crash/25043 "2017-06-07T12:15:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chinmay](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@Chinmay](https://root-forum.cern.ch/u/Chinmay)\
**Post date:** [June 7, 2017, 12:15pm UTC](https://root-forum.cern.ch/t/pyrandomforest-tmva-reader-crash/25043/1 "2017-06-07T12:15:01Z")

</div>

Hi,  
I am trying to use TMVA PyRandomForest. I am able to do the training,testing and evaluation smoothly,  
However when I try to Evaluate MVA using TMVA::Reader I get following crash.

```auto
Info in <MMLResponse::LoadData>: Loaded data from /home/chinmay/MaceSIM-PROOF-TestData/Test5Deg/GammaPar.root/HParameters 

                         : 
                         : --- Loading State File From:/PyRFModel.PyData
                         : 

 ***Break*** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007feed4b0049a in waitpid () from /lib64/libc.so.6
#1 0x00007feed4a7b9ab in do_system () from /lib64/libc.so.6
#2 0x00007feed5b7be01 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x8ea4f0) at /home/chinmay/ROOT/root-6.08.04/core/unix/src/TUnixSystem.cxx:2118
#3 TUnixSystem::StackTrace (this=0x8ea4f0) at /home/chinmay/ROOT/root-6.08.04/core/unix/src/TUnixSystem.cxx:2405
#4 0x00007feed5b7e51c in TUnixSystem::DispatchSignals (this=0x8ea4f0, sig=kSigSegmentationViolation) at /home/chinmay/ROOT/root-6.08.04/core/unix/src/TUnixSystem.cxx:3663
#5 <signal handler called>
#6 TMVA::PyMethodBase::UnSerialize (path=..., obj=obj
entry=0x278a4b8) at /home/chinmay/ROOT/root-6.08.04/tmva/pymva/src/PyMethodBase.cxx:236
#7 0x00007feebdf49048 in TMVA::MethodPyRandomForest::ReadModelFromFile (this=0x278a060) at /home/chinmay/ROOT/root-6.08.04/tmva/pymva/src/MethodPyRandomForest.cxx:422
#8 0x00007feebdf4716c in TMVA::MethodPyRandomForest::GetMvaValue (this=0x278a060, errLower=<optimized out>, errUpper=<optimized out>) at /home/chinmay/ROOT/root-6.08.04/tmva/pymva/src/MethodPyRandomForest.cxx:390
#9 0x00007feebe452684 in TMVA::Reader::EvaluateMVA (this=this
entry=0x1ce2270, methodTag=..., aux=aux
entry=0) at /home/chinmay/ROOT/root-6.08.04/tmva/tmva/src/Reader.cxx:560
#10 0x00007feec1433061 in MMLResponse::EvaluateMVA (this=0x7feed62cc020, pathtodata=<optimized out>, datatree=<optimized out>, outfile=<optimized out>, outtree=<optimized out>, analysistype=<optimized out>, aux=0x0) at /home/chinmay/MaceSIM-PROOF-DEV/MaceSIM/src/SimManager/MSimTMVAInterface.cxx:714
#11 0x00007feed629d088 in ?? ()
#12 0x0000000000000000 in ?? ()
===========================================================

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum.
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6 TMVA::PyMethodBase::UnSerialize (path=..., obj=obj
entry=0x278a4b8) at /home/chinmay/ROOT/root-6.08.04/tmva/pymva/src/PyMethodBase.cxx:236
#7 0x00007feebdf49048 in TMVA::MethodPyRandomForest::ReadModelFromFile (this=0x278a060) at /home/chinmay/ROOT/root-6.08.04/tmva/pymva/src/MethodPyRandomForest.cxx:422
#8 0x00007feebdf4716c in TMVA::MethodPyRandomForest::GetMvaValue (this=0x278a060, errLower=<optimized out>, errUpper=<optimized out>) at /home/chinmay/ROOT/root-6.08.04/tmva/pymva/src/MethodPyRandomForest.cxx:390
#9 0x00007feebe452684 in TMVA::Reader::EvaluateMVA (this=this
entry=0x1ce2270, methodTag=..., aux=aux
entry=0) at /home/chinmay/ROOT/root-6.08.04/tmva/tmva/src/Reader.cxx:560
#10 0x00007feec1433061 in MMLResponse::EvaluateMVA (this=0x7feed62cc020, pathtodata=<optimized out>, datatree=<optimized out>, outfile=<optimized out>, outtree=<optimized out>, analysistype=<optimized out>, aux=0x0) at /home/chinmay/MaceSIM-PROOF-DEV/MaceSIM/src/SimManager/MSimTMVAInterface.cxx:714
#11 0x00007feed629d088 in ?? ()
#12 0x0000000000000000 in ?? ()
===========================================================

Root > 

```

I tried to change the directory and even tried to evaluate the MVA from the same directory that containes ‘.weights.xml’ file. It doesn’t work.  
Please help.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [June 7, 2017, 12:55pm UTC](https://root-forum.cern.ch/t/pyrandomforest-tmva-reader-crash/25043/2 "2017-06-07T12:55:19Z")

</div>

I think the information provided is insufficient to allow us to help debug your problem.  
Could you please provide a script that we can run to reproduce your problem?
