Fix dump model. (#5485)
This commit is contained in:
@@ -663,7 +663,6 @@ inline void XGBoostDumpModelImpl(BoosterHandle handle, const FeatureMap &fmap,
|
||||
auto *bst = static_cast<Learner*>(handle);
|
||||
std::vector<std::string>& str_vecs = bst->GetThreadLocal().ret_vec_str;
|
||||
std::vector<const char*>& charp_vecs = bst->GetThreadLocal().ret_vec_charp;
|
||||
bst->Configure();
|
||||
str_vecs = bst->DumpModel(fmap, with_stats != 0, format);
|
||||
charp_vecs.resize(str_vecs.size());
|
||||
for (size_t i = 0; i < str_vecs.size(); ++i) {
|
||||
|
||||
@@ -897,9 +897,8 @@ class LearnerImpl : public LearnerIO {
|
||||
|
||||
std::vector<std::string> DumpModel(const FeatureMap& fmap,
|
||||
bool with_stats,
|
||||
std::string format) const override {
|
||||
CHECK(!this->need_configuration_)
|
||||
<< "The model hasn't been built yet. Are you using raw Booster interface?";
|
||||
std::string format) override {
|
||||
this->Configure();
|
||||
return gbm_->DumpModel(fmap, with_stats, format);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user