1

I am using lihgtgbm GPU for training, and the error "[LightGBM] [Fatal] bin size 1141 cannot run on GPU" is prompted. The error is "lightgbm.basic.LightGBMError: bin size 1141 cannot run on GPU".

[LightGBM] [Warning] Categorical features with more bins than the configured maximum bin number found.
[LightGBM] [Warning] For categorical features, max_bin and max_bin_by_feature may be ignored with a large number of categories.
[LightGBM] [Info] Number of positive: 15108, number of negative: 1492392
[LightGBM] [Info] This is the GPU trainer!!
[LightGBM] [Info] Total Bins 13145
[LightGBM] [Info] Number of data points in the train set: 1507500, number of used features: 94
[LightGBM] [Fatal] bin size 1141 cannot run on GPU
Traceback (most recent call last):
  File "train.py", line 68, in <module>
    main()
  File "train.py", line 59, in main
    train(params, tc)
  File "D:\python\model_ls\ywls\model.py", line 120, in train
    callbacks=callbacks
  File "D:\server\Anaconda3\envs\lgb-gpu\lib\site-packages\lightgbm\engine.py", line 222, in train
    booster = Booster(params=params, train_set=train_set)
  File "D:\server\Anaconda3\envs\lgb-gpu\lib\site-packages\lightgbm\basic.py", line 2673, in __init__
    ctypes.byref(self.handle)))
  File "D:\server\Anaconda3\envs\lgb-gpu\lib\site-packages\lightgbm\basic.py", line 141, in _safe_call
    raise LightGBMError(_LIB.LGBM_GetLastError().decode('utf-8'))
lightgbm.basic.LightGBMError: bin size 1141 cannot run on GPU

1 Answers1

0

You can look at the following link, which is about the introduction to "max_bin", you can set it as max_bin=255

LGBM max_bin

max_bin, default = 255, type =int, aliases: max_bins, constraints: max_bin > 1

max number of bins that feature values will be bucketed in small number of bins may reduce training accuracy but may increase general power (deal with over-fitting)

LightGBM will auto compress memory according to max_bin.

For example, LightGBM will use uint8_t for feature value if max_bin=255

Hong Cheng
  • 318
  • 1
  • 4
  • 19