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(),