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
The leaf values (leaf outputs) can become denormal doubles, meaning their absolute value is less than the minimum positive normal value of a double. (https://en.wikipedia.org/wiki/Denormal_number)
You can check the minimum value for normal and denormal doubles in C++ with std::numeric_limits<double>::min() and std::numeric_limits<double>::denorm_min().
This can cause that when loading the model from a string, you get an std::out_of_range exception because std::stod() cannot transform a string representing a denormal double to double.
I propose a solution where the leaf outputs are rounded to zero if they are denormal.
Unfortunately, I cannot give you an example of how the model was made because the data I used is sensitive. I can say that I encountered this problem with quantile regression and with many different parameter combinations.
Environment info
Operating System: Ubuntu 18.04.3 LTS
CPU/GPU model: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Python version: 3.7.4
g++ version: 7.4.0
LightGBM version: 2.3.2
Error message
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
[LightGBM] [Warning] stod
terminate called without an active exception
Process finished with exit code 134
Reproducible examples
import lightgbm as lgb
booster = lgb.Booster(model_file='model_string.txt')
The leaf values (leaf outputs) can become denormal doubles, meaning their absolute value is less than the minimum positive normal value of a double. (https://en.wikipedia.org/wiki/Denormal_number)
You can check the minimum value for normal and denormal doubles in C++ with
std::numeric_limits<double>::min()
andstd::numeric_limits<double>::denorm_min()
.This can cause that when loading the model from a string, you get an
std::out_of_range
exception becausestd::stod()
cannot transform a string representing a denormal double to double.I propose a solution where the leaf outputs are rounded to zero if they are denormal.
Unfortunately, I cannot give you an example of how the model was made because the data I used is sensitive. I can say that I encountered this problem with quantile regression and with many different parameter combinations.
Environment info
Operating System: Ubuntu 18.04.3 LTS
CPU/GPU model: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Python version: 3.7.4
g++ version: 7.4.0
LightGBM version: 2.3.2
Error message
Reproducible examples
Steps to reproduce
The text was updated successfully, but these errors were encountered: