This commit is contained in:
tqchen 2015-04-06 14:53:40 -07:00
parent 99f8dd280e
commit 01771c813d

View File

@ -173,8 +173,10 @@ class BoostLearner : public rabit::ISerializable {
utils::Check(fi.Read(&gap, sizeof(gap)) != 0, "BoostLearner: wrong model format"); utils::Check(fi.Read(&gap, sizeof(gap)) != 0, "BoostLearner: wrong model format");
len = len >> 32UL; len = len >> 32UL;
} }
name_obj_.resize(len); if (len != 0) {
utils::Check(fi.Read(&name_obj_[0], len) != 0, "BoostLearner: wrong model format"); name_obj_.resize(len);
utils::Check(fi.Read(&name_obj_[0], len) != 0, "BoostLearner: wrong model format");
}
} }
utils::Check(fi.Read(&name_gbm_), "BoostLearner: wrong model format"); utils::Check(fi.Read(&name_gbm_), "BoostLearner: wrong model format");
// delete existing gbm if any // delete existing gbm if any