I started working with SMILE a couple of months ago. I implemented some learning and inference using Visual Studio and it had all been working fine. However, I recently had the need to do inference in Linux (Ubuntu) so I ported my code from Windows (which was basically a copy/paste) and used the same library version (but gcc binaries). Everything compiles just fine but the DSL_network::UpdateBeliefs() function is causing a segmentation fault. I'm feeding the program the same XDSL for the trained network and the exact same evidence in both Windows and Linux but, as I mentioned, it crashes on the latter one.
Since the crash is happening inside the SMILE library, I am at a loss. Your help will be immensely appreciated.
Thank you.
This is the call stack:
Code: Select all
#0 0x000000000062f428 in TsClique::SortNodes() ()
#1 0x000000000057ada8 in TsTriangulator::Triangulate(unsigned int) ()
#2 0x0000000000578258 in TsJoinTree::Triangulate(unsigned int) ()
#3 0x0000000000578e50 in TsJoinTree::UpdateBeliefsEx(bool*, unsigned int) ()
#4 0x0000000000576622 in (anonymous namespace)::DoClustering(DSL_network*, bool*, int, int&) ()
#5 0x0000000000576e3e in TsClustering(DSL_network*) ()
#6 0x000000000055f92f in DSL_network::CallBNAlgorithm() ()
#7 0x000000000055d9f0 in DSL_network::UpdateBeliefs() ()
Code: Select all
DSL_network cwNetwork;
cwNetwork.ReadFile("data/Network-Learned.xdsl", DSL_XDSL_FORMAT);
cwNetwork.SetDefaultBNAlgorithm(DSL_ALG_BN_LAURITZEN);
int node1 = cwNetwork.FindNode("Node1");
int node2 = cwNetwork.FindNode("Node2");
int resNode = cwNetwork.FindNode("ResNode");
cwNetwork.ClearAllEvidence();
cwNetwork.GetNode(node1)->Value()->SetEvidence(5);
cwNetwork.GetNode(node2)->Value()->SetEvidence(1);
cwNetwork.UpdateBeliefs();