From 93c28dfd40717498243df3bdd96ad97f51e877ea Mon Sep 17 00:00:00 2001 From: jiamingy Date: Fri, 15 Apr 2022 14:56:52 +0800 Subject: [PATCH] Fix training continuation with categorical model. * Make sure the task is initialized before construction of tree updater. This is a quick fix meant to be backported to 1.6, for a full fix we should pass the model param into tree updater by reference instead. --- src/learner.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/learner.cc b/src/learner.cc index 73447cf2ef1a..370b46190b3c 100644 --- a/src/learner.cc +++ b/src/learner.cc @@ -419,6 +419,7 @@ class LearnerConfiguration : public Learner { obj_.reset(ObjFunction::Create(tparam_.objective, &generic_parameters_)); } obj_->LoadConfig(objective_fn); + learner_model_param_.task = obj_->Task(); tparam_.booster = get(gradient_booster["name"]); if (!gbm_) {