From 41eadc573bab945ca8bd4e1760fe25defca81fc1 Mon Sep 17 00:00:00 2001 From: jiamingy Date: Mon, 1 Feb 2021 17:46:48 +0800 Subject: [PATCH] Revert "Use config instead." This reverts commit 6c21e7ea70143673d1be807cb239d1fc082666a4. --- python-package/xgboost/dask.py | 4 +--- src/learner.cc | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/python-package/xgboost/dask.py b/python-package/xgboost/dask.py index 75f8c10bbffb..1db49804546e 100644 --- a/python-package/xgboost/dask.py +++ b/python-package/xgboost/dask.py @@ -1009,10 +1009,8 @@ def _infer_predict_output( test_sample = rng.randn(1, features) if inplace: # clear the state to avoid gpu_id, gpu_predictor - booster_config = booster.save_config() - booster.set_param({"predictor": "cpu_predictor", "gpu_id": -1}) + booster = Booster(model_file=booster.save_raw()) test_predt = booster.inplace_predict(test_sample, **kwargs) - booster.load_config(booster_config) else: m = DMatrix(test_sample) test_predt = booster.predict(m, **kwargs) diff --git a/src/learner.cc b/src/learner.cc index 5d062b32e8dd..cb0618295d93 100644 --- a/src/learner.cc +++ b/src/learner.cc @@ -354,7 +354,6 @@ class LearnerConfiguration : public Learner { void LoadConfig(Json const& in) override { CHECK(IsA(in)); - std::lock_guard guard(config_lock_); Version::Load(in); auto const& learner_parameters = get(in["learner"]); @@ -420,7 +419,6 @@ class LearnerConfiguration : public Learner { } void SetParam(const std::string& key, const std::string& value) override { - std::lock_guard guard(config_lock_); this->need_configuration_ = true; if (key == kEvalMetric) { if (std::find(metric_names_.cbegin(), metric_names_.cend(),