python - 在 GPU 上运行 Lightgbm 时出现意外的关键字参数

标签 python gpu lightgbm

运行以下代码时:

import lightgbm as lgb

params = {'num_leaves': 38,              
          'min_data_in_leaf': 50,
          'objective': 'regression',     
          'max_depth': -1,                
          'learning_rate': 0.1,           
          'device': 'gpu'
          }
trn_data = lgb.Dataset(x_train, y_train)
val_data = lgb.Dataset(x_test, y_test)

model = lgb.train(params,
                trn_data,
                20000,
                valid_sets=[trn_data, val_data],
                verbose_eval=300,
                early_stopping_rounds=1000)

我收到以下错误:

train() got an unexpected keyword argument 'verbose_eval'
train() got an unexpected keyword argument 'early_stopping_rounds'

值得注意的是,我是在 GPU 上运行它的。当在 CPU 上运行时,我没有收到此错误。

有人知道如何在 GPU 上运行 Lightgbm 时合并详细输出和提前停止回合吗?

最佳答案

关于GPU上的Lightgbm可以查看官方文档。在文档中没有 vebose_ecal 和 Early_stopping_rounds 这样的配置选项 Official Documentation

您也可以查看此链接Running LightGBM on GPU with python

关于python - 在 GPU 上运行 Lightgbm 时出现意外的关键字参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73346395/

相关文章:

python - 自动运行 python 结果为 "EOF when reading a line "

python - 如何将类的实例作为参数传递给装饰类中定义的实例方法的装饰器?

cuda - 当 block 的数量少于可用的 SM 时,如何将它们调度到 CUDA 中的 SM 中?

LightGbm:如何使用 eval_sample_weight

python - Lightgbm OSError,库未加载

lightgbm - 如何正确保存mlr3 lightgbm模型?

python - 在 Python 中迭代列表的列表

python - Bash 脚本找不到 Python MySQL.Connector 模块

opengl - 是否可以比屏幕刷新率更快地进行 GPU 加速 3D 渲染?

在 VS2010 的 CUDA C 中编译计算能力 2.x