Better error message for updating. (#5418)

This commit is contained in:
Jiaming Yuan 2020-03-15 16:46:21 +08:00 committed by GitHub
parent ab7a46a1a4
commit fc88105620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,7 +279,9 @@ void GBTree::BoostNewTrees(HostDeviceVector<GradientPair>* gpair,
<< "can not be used to modify existing trees. "
<< "Set `process_type` to `default` if you want to build new trees.";
}
CHECK_LT(model_.trees.size(), model_.trees_to_update.size());
CHECK_LT(model_.trees.size(), model_.trees_to_update.size())
<< "No more tree left for updating. For updating existing trees, "
<< "boosting rounds can not exceed previous training rounds";
// move an existing tree from trees_to_update
auto t = std::move(model_.trees_to_update[model_.trees.size() +
bst_group * tparam_.num_parallel_tree + i]);