LightGBM icon indicating copy to clipboard operation
LightGBM copied to clipboard

Segmentation fault when initial score size doesn't equal to data

Open wxchan opened this issue 10 years ago • 4 comments

If the init_score file does not exists or its size does not match training data, I think it should get same result without init_score file.

But the log is like this (on ubuntu 16.04):

[LightGBM] [Info] Loading parameters .. finished [LightGBM] [Info] Start loading initial scores [LightGBM] [Error] Initial score size doesn't equal to data, score file will be ignored [LightGBM] [Info] Finish loading data, use 0.042958 seconds [LightGBM] [Info] Number of data:7000, Number of features:28 [LightGBM] [Info] Finish training initilization. [LightGBM] [Info] Start train ... [LightGBM] [Info] re-bagging, using 5600 data to train [LightGBM] [Info] cannot find more split with gain = -inf , current #leaves=3 [LightGBM] [Info] Iteration:1, training's l2 loss : -nan [LightGBM] [Info] Iteration:1, regression.test's l2 loss : -nan [LightGBM] [Info] 0.000481 seconds elapsed, finished 1 iteration [LightGBM] [Info] cannot find more split with gain = -inf , current #leaves=3 [LightGBM] [Info] Iteration:2, training's l2 loss : -nan [LightGBM] [Info] Iteration:2, regression.test's l2 loss : -nan [LightGBM] [Info] 0.000923 seconds elapsed, finished 2 iteration [LightGBM] [Info] cannot find more split with gain = -inf , current #leaves=3 [LightGBM] [Info] Iteration:3, training's l2 loss : -nan [LightGBM] [Info] Iteration:3, regression.test's l2 loss : -nan [LightGBM] [Info] 0.001280 seconds elapsed, finished 3 iteration [LightGBM] [Info] cannot find more split with gain = -inf , current #leaves=1 [LightGBM] [Info] Can't training anymore, there isn't any leaf meets split requirements. [LightGBM] [Info] 0.001448 seconds elapsed, finished 4 iteration [LightGBM] [Info] Finished train Segmentation fault (core dumped)

Another bug report on Mac:

lightgbm(32636,0x7fffb2c553c0) malloc: *** error for object 0x7fa7d2c03b10: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6

Btw, since multiclass classification scores have different formats, it's not supported yet.

wxchan avatar Nov 01 '16 07:11 wxchan

it seems init_socres_ is delete, but forget to set to "nullptr". Is it the same error in Mac ?

guolinke avatar Nov 01 '16 07:11 guolinke

Yes, same error on Mac.

Perhaps you could change Error to Fatal here. Because when users set init_score, they probably want it works rather than be ignored. (They might not see the Error log.) They can make their own decisions by deleting init_score.

wxchan avatar Nov 01 '16 08:11 wxchan

@wxchan thanks, it is a good point.

guolinke avatar Nov 01 '16 08:11 guolinke

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

github-actions[bot] avatar Aug 24 '23 04:08 github-actions[bot]