Open geektoni opened 4 years ago
Hmmm, I guess this is why the random forest meta example sometimes fails locally... Have you tried to run it in gdb yet?
Hmmm, I guess this is why the random forest meta example sometimes fails locally... Have you tried to run it in gdb yet?
Nope, I still need to check properly.
The stacktrace is the following:
#0 0x00007ffff58156b4 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count (this=0x7fffce914c38, __r=...)
at /usr/include/c++/7/bits/shared_ptr_base.h:849
#1 0x00007ffff57cb20d in std::__shared_ptr<shogun::SGObject, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<shogun::SGObject, void> (
this=0x7fffce914c30, __r=...) at /usr/include/c++/7/bits/shared_ptr_base.h:1147
#2 0x00007ffff576818b in std::shared_ptr<shogun::SGObject>::shared_ptr<shogun::SGObject, void> (this=0x7fffce914c30, __r=...)
at /usr/include/c++/7/bits/shared_ptr.h:266
#3 0x00007ffff570f315 in std::enable_shared_from_this<shogun::SGObject>::shared_from_this (this=0x8)
at /usr/include/c++/7/bits/shared_ptr.h:640
#4 0x00007ffff579fe15 in shogun::SGObject::as<shogun::BinaryTreeMachineNode<shogun::CARTreeNodeData> > (this=0x0)
at /home/gdetoni/Github/shogun/src/shogun/base/SGObject.h:641
#5 0x00007ffff1f2fc00 in shogun::CARTree::apply_regression (this=0x555556162e90, data=...)
at /home/gdetoni/Github/shogun/src/shogun/multiclass/tree/CARTree.cpp:142
#6 0x00007ffff12bd75f in shogun::Machine::apply (this=0x555556162e90, data=...)
at /home/gdetoni/Github/shogun/src/shogun/machine/Machine.cpp:128
#7 0x00007ffff1285fdf in shogun::BaggingMachine::apply_outputs_without_combination(std::shared_ptr<shogun::Features>) [clone ._omp_fn.0]
() at /home/gdetoni/Github/shogun/src/shogun/machine/BaggingMachine.cpp:114
#8 0x00007fffeac166d5 in gomp_thread_start (xdata=<optimized out>)
at /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/libgomp/team.c:123
#9 0x00007ffff7bbd6db in start_thread (arg=0x7fffce915700) at pthread_create.c:463
#10 0x00007ffff78e688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
It seems like we have some null pointer here...
From what I can tell is that m_root
contains a nullptr
. It seems like that is the default value in the default constructor. And you can see that it says there that m_root
has not been added to the parameter framework, so it is not being serialised. I am not sure why it is not being registered as an SGObject though? That should work fine.
Thank you @gf712 for the insight!
If we add m_root
as a parameter we will get the following messages once we try to deserialize:
[06/09/20 10:45:49 error] Could not create 'BinaryTreeMachineNode' class
[06/09/20 10:45:49 warning] Error while deserializeing RandomCARTree: ShogunException: Could not create 'BinaryTreeMachineNode' class
The issue should be caused by this problem below here (taken from the source code).
// the problem is "CARTree"/"RandomCARTree" can't be cloned because
// they inherit from TreeMachine which is templated and can't be
// created in class_list
// SG_ADD((std::shared_ptr<SGObject>*)&m_root,"m_root", "tree structure");
I am not super familiar with the serialization framework, so are there any possible ways to make it work again?
Hmm I see, it needs the template parameter. @vigsterkr I guess we need to replace TreeMachineNode
with non templated version?
Got a segfault as well deserializing a random forest using c++ (develop version and release 6.1.4). Same issue was presented in previous issues, latter discussed a workaround:
https://github.com/shogun-toolbox/shogun/issues/3481 https://github.com/shogun-toolbox/shogun/issues/4242
Is there any update to this issue?
When using the python interface, if we serialize and then deserialize a
RandomForest
object, we will get asegfault
if we try to call theapply_regression
method from the deserialized object. See the code below for an example.