简体   繁体   English

lightgbm.basic.LightGBMError:检查失败:(best_split_info.left_count)>(0)

[英]lightgbm.basic.LightGBMError: Check failed: (best_split_info.left_count) > (0)

There's a couple of other questions similar to this, but I couldn't find a solution which seems to fit.还有其他几个与此类似的问题,但我找不到似乎适合的解决方案。 I am using LightGBM with Scikit-Optimize BayesSearchCV.我正在将 LightGBM 与 Scikit-Optimize BayesSearchCV 一起使用。

full_pipeline = skl.Pipeline(steps=[('preprocessor', pre_processor), 
                                        ('estimator',    lgbm.sklearn.LGBMClassifier())])
scorer=make_scorer(fl.lgb_focal_f1_score)
lgb_tuner = sko.BayesSearchCV(full_pipeline, hyper_space, cv=5, refit=True, n_iter=num_calls,scoring=scorer)
lgb_tuner.fit(balanced_xtrain, balanced_ytrain)

Training runs for a while, before it errors with the following:训练运行了一段时间,然后出现以下错误:

Traceback (most recent call last):
  File "/var/training.py", line 134, in <module>
    lgb_tuner.fit(balanced_xtrain, balanced_ytrain)
  File "/usr/local/lib/python3.6/site-packages/skopt/searchcv.py", line 694, in fit
    groups=groups, n_points=n_points_adjusted
  File "/usr/local/lib/python3.6/site-packages/skopt/searchcv.py", line 579, in _step
    self._fit(X, y, groups, params_dict)
  File "/usr/local/lib/python3.6/site-packages/skopt/searchcv.py", line 423, in _fit
    for parameters in parameter_iterable
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 1041, in __call__
    if self.dispatch_one_batch(iterator):
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 859, in dispatch_one_batch
    self._dispatch(tasks)
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 777, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/usr/local/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 208, in apply_async
    result = ImmediateResult(func)
  File "/usr/local/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 572, in __init__
    self.results = batch()
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 263, in __call__
    for func, args, kwargs in self.items]
  File "/usr/local/lib/python3.6/site-packages/joblib/parallel.py", line 263, in <listcomp>
    for func, args, kwargs in self.items]
  File "/usr/local/lib/python3.6/site-packages/sklearn/model_selection/_validation.py", line 531, in _fit_and_score
    estimator.fit(X_train, y_train, **fit_params)
  File "/usr/local/lib/python3.6/site-packages/sklearn/pipeline.py", line 335, in fit
    self._final_estimator.fit(Xt, y, **fit_params_last_step)
  File "/usr/local/lib/python3.6/site-packages/lightgbm/sklearn.py", line 857, in fit
    callbacks=callbacks, init_model=init_model)
  File "/usr/local/lib/python3.6/site-packages/lightgbm/sklearn.py", line 617, in fit
    callbacks=callbacks, init_model=init_model)
  File "/usr/local/lib/python3.6/site-packages/lightgbm/engine.py", line 252, in train
    booster.update(fobj=fobj)
  File "/usr/local/lib/python3.6/site-packages/lightgbm/basic.py", line 2467, in update
    return self.__boost(grad, hess)
  File "/usr/local/lib/python3.6/site-packages/lightgbm/basic.py", line 2503, in __boost
    ctypes.byref(is_finished)))
  File "/usr/local/lib/python3.6/site-packages/lightgbm/basic.py", line 55, in _safe_call
    raise LightGBMError(decode_string(_LIB.LGBM_GetLastError()))
lightgbm.basic.LightGBMError: Check failed: (best_split_info.left_count) > (0) at /__w/1/s/python-package/compile/src/treelearner/serial_tree_learner.cpp, line 651 .

Some answers to similar questions have suggested it might be as a consequence of using the GPU, but I do not have a GPU available.对类似问题的一些回答表明,这可能是使用 GPU 的结果,但我没有可用的 GPU。 I don't know what else is causing it or how to try and fix it.我不知道还有什么原因导致它或如何尝试修复它。 Can anyone suggest anything?任何人都可以提出任何建议吗?

I think this was due to my hyperparameter limits being wrong, causing one hyperparameter to be set to zero which shouldn't have been, though I'm not sure which one.我认为这是由于我的超参数限制错误,导致一个超参数设置为零,这不应该是,尽管我不确定是哪一个。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有 Sklearn RandomizedSearchCV 的 LightGBMError “检查失败:num_data &gt; 0” - LightGBMError "Check failed: num_data > 0" with Sklearn RandomizedSearchCV 使用 GPU 尝试 LightGBM,但出现错误:LightGBMError: No OpenCL device found - Try LightGBM with GPU with error: LightGBMError: No OpenCL device found LightGBMError:b&#39;检查失败:配置-&gt; bagging_freq&gt; 0 &amp;&amp;配置-&gt; bagging_fraction &lt;1.0f &amp;&amp;配置-&gt; bagging_fraction&gt; 0.0f - LightGBMError: b'Check failed: config->bagging_freq > 0 && config->bagging_fraction < 1.0f && config->bagging_fraction > 0.0f LightGBM 最佳迭代总是返回 1 - LightGBM best iteration always return 1 需要将一列中的 info(,) 拆分为两个并更改左上角名称...通常的解决方案不起作用 - Need to split info(,) in a column into two & change top left corner name... usual solutions not working Python:如何从 Optuna LightGBM 研究中检索最佳 model? - Python: How to retrive the best model from Optuna LightGBM study? lightgbm.sklearn.LGBMRegressor 未能拟合简单的线条 - lightgbm.sklearn.LGBMRegressor failed to fit simple line 在 LightGBM 上添加 predict_disable_shape_check=true 作为参数 - Adding predict_disable_shape_check=true as a parameter on LightGBM LightGBMError: b&#39;未找到 OpenCL 设备&#39; - LightGBMError: b'No OpenCL device found' lightgbm 的importance_type &#39;split&#39; 是否与xgboost 中的importance_type &#39;weight&#39; 相同? - Is the importance_type 'split' of lightgbm the same as the importance_type 'weight` in xgboost?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM