You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Running] C:\Users\hahy\Miniconda3\envs\ml\python.exe -u "c:\Users\hahy\examples\xgboost_integration.py"
[I 2023-09-15 17:24:25,730] A new study created in memory with name: no-name-d56dde96-9338-4236-ad38-c39f799c7fdb
[W 2023-09-15 17:24:25,776] Trial 0 failed with parameters: {'booster': 'gbtree', 'lambda': 0.07152539971374029, 'alpha': 0.5186515246328354, 'max_depth': 5, 'eta': 2.503213997637747e-05, 'gamma': 0.001738417857798512, 'grow_policy': 'depthwise'} because of the following error: TypeError('callback must be an instance of `TrainingCallback`.').
Traceback (most recent call last):
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\optuna\study\_optimize.py", line 200, in _run_trial
value_or_values = func(trial)
^^^^^^^^^^^
File "c:\Users\hahy\examples\xgboost_integration.py", line 52, in objective
bst = xgb.train(param, dtrain, evals=[(dvalid, "validation")], callbacks=[pruning_callback])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\xgboost\core.py", line 729, in inner_f
return func(**kwargs)
^^^^^^^^^^^^^^
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\xgboost\training.py", line 167, in train
cb_container = CallbackContainer(
^^^^^^^^^^^^^^^^^^
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\xgboost\callback.py", line 139, in __init__
raise TypeError("callback must be an instance of `TrainingCallback`.")
TypeError: callback must be an instance of `TrainingCallback`.
[W 2023-09-15 17:24:25,780] Trial 0 failed with value None.
Traceback (most recent call last):
File "c:\Users\hahy\examples\xgboost_integration.py", line 63, in <module>
study.optimize(objective, n_trials=100)
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\optuna\study\study.py", line 442, in optimize
_optimize(
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\optuna\study\_optimize.py", line 66, in _optimize
_optimize_sequential(
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\optuna\study\_optimize.py", line 163, in _optimize_sequential
frozen_trial = _run_trial(study, func, catch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\optuna\study\_optimize.py", line 251, in _run_trial
raise func_err
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\optuna\study\_optimize.py", line 200, in _run_trial
value_or_values = func(trial)
^^^^^^^^^^^
File "c:\Users\hahy\examples\xgboost_integration.py", line 52, in objective
bst = xgb.train(param, dtrain, evals=[(dvalid, "validation")], callbacks=[pruning_callback])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\xgboost\core.py", line 729, in inner_f
return func(**kwargs)
^^^^^^^^^^^^^^
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\xgboost\training.py", line 167, in train
cb_container = CallbackContainer(
^^^^^^^^^^^^^^^^^^
File "C:\Users\hahy\Miniconda3\envs\ml\Lib\site-packages\xgboost\callback.py", line 139, in __init__
raise TypeError("callback must be an instance of `TrainingCallback`.")
TypeError: callback must be an instance of `TrainingCallback`.
The text was updated successfully, but these errors were encountered:
anhailing
added
the
bug
Issue/PR about behavior that is broken. Not for typos/CI but for example itself.
label
Sep 15, 2023
anhailing
changed the title
error occurred running xgboost_integration.py
optuna.integration.XGBoostPruningCallback is not xgboost TrainingCallback
Sep 15, 2023
Code downloaded at https://github.com/optuna/optuna-examples/blob/main/xgboost/xgboost_integration.py errored out during execution.
Environment
Error messages, stack traces, or logs
Steps to reproduce
Reproducible examples (optional)
Additional context (optional)
The text was updated successfully, but these errors were encountered: