[mlpack] 04/40: Be sure to serialize and deserialize in the same way!

Barak A. Pearlmutter barak+git at pearlmutter.net
Mon Feb 15 19:34:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch master
in repository mlpack.

commit 10907ad76630f824e46a15a464763e28ee930e89
Author: Ryan Curtin <ryan at ratml.org>
Date:   Thu Dec 31 12:58:58 2015 -0800

    Be sure to serialize and deserialize in the same way!
    
    In this case I serialized as a pointer and deserialized as an object.  This
    causes disaster, but figuring out what the disaster was required digging into
    Boost, recompiling with debugging symbols, stepping through the nightmare
    serialization code, reasoning about what was going wrong, and ultimately fixing
    it by changing one single character.  Sigh.  Let this be a warning to whomever
    reads this, although that person will probably only read this after having
    already gone through the horrible process outlined above...
---
 src/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp b/src/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp
index 6d31bf5..0a60463 100644
--- a/src/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp
+++ b/src/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp
@@ -328,7 +328,7 @@ void PerformActions(const typename TreeType::NumericSplit& numericSplit)
 
   // Check the accuracy on the training set.
   if (!outputModelFile.empty())
-    data::Save(outputModelFile, "streamingDecisionTree", tree, true);
+    data::Save(outputModelFile, "streamingDecisionTree", *tree, true);
 
   // Clean up memory.
   delete tree;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list