[mlpack-git] master: Be sure to serialize and deserialize in the same way! (7f4c62b)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Dec 31 16:01:09 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/7b10efdbc1dececa97254f1bcf615250a8e04e6e...7f4c62b81874f816229cd34330635d1ab776acda
>---------------------------------------------------------------
commit 7f4c62b81874f816229cd34330635d1ab776acda
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...
>---------------------------------------------------------------
7f4c62b81874f816229cd34330635d1ab776acda
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 c29cc44..073c00b 100644
--- a/src/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp
+++ b/src/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp
@@ -321,7 +321,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;
More information about the mlpack-git
mailing list