Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0 when copy underlying booster #5699

Closed
sh1ng opened this issue May 22, 2020 · 5 comments

Comments

@sh1ng
Copy link
Contributor

sh1ng commented May 22, 2020

version 1.1

Looks similar to #5276

[2020-05-22T15:21:46.406Z] xgboost.core.XGBoostError: [15:21:45] /root/repo/xgboost/src/objective/./regression_loss.h:89: Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0
[2020-05-22T15:21:46.406Z] Stack trace:
[2020-05-22T15:21:46.406Z]   [bt] (0) /opt/h2oai/dai/cpu-only/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x6a) [0x1506d9a1377a]
[2020-05-22T15:21:46.406Z]   [bt] (1) /opt/h2oai/dai/cpu-only/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(xgboost::obj::LogisticRegression::ProbToMargin(float)+0xbf) [0x1506d9cf650f]
[2020-05-22T15:21:46.406Z]   [bt] (2) /opt/h2oai/dai/cpu-only/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(xgboost::LearnerIO::LoadModel(dmlc::Stream*)+0x14d2) [0x1506d9b23672]
[2020-05-22T15:21:46.406Z]   [bt] (3) /opt/h2oai/dai/cpu-only/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(xgboost::LearnerIO::Load(dmlc::Stream*)+0x2c4) [0x1506d9b21c84]
[2020-05-22T15:21:46.407Z]   [bt] (4) /opt/h2oai/dai/cpu-only/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(XGBoosterUnserializeFromBuffer+0x4e) [0x1506d9a1a74e]
[2020-05-22T15:21:46.407Z]   [bt] (5) /opt/h2oai/dai/lib/libffi.so.6(ffi_call_unix64+0x4c) [0x1507b54c6e2c]
[2020-05-22T15:21:46.407Z]   [bt] (6) /opt/h2oai/dai/lib/libffi.so.6(ffi_call+0x1f5) [0x1507b54c6755]
[2020-05-22T15:21:46.407Z]   [bt] (7) /opt/h2oai/dai/python/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(_ctypes_callproc+0x283) [0x1507b56da683]
[2020-05-22T15:21:46.407Z]   [bt] (8) /opt/h2oai/dai/python/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(+0x8d3f) [0x1507b56d1d3f]
@hcho3
Copy link
Collaborator

hcho3 commented May 23, 2020

Is it possible to share your model and script?

@sh1ng sh1ng changed the title Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0 Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0 when clone model May 27, 2020
@sh1ng sh1ng changed the title Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0 when clone model Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0 when underlying booster May 27, 2020
@sh1ng
Copy link
Contributor Author

sh1ng commented May 27, 2020

Found a simple way to reproduce. Take temp_.zip model from #5276 load and clone underlying booster.

>>> import xgboost
>>> new_model = xgboost.XGBModel()
>>> new_model.load_model('temp_.model')
>>> booster = new_model.get_booster().copy()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/core.py", line 1259, in copy
    return self.__copy__()
  File "/home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/core.py", line 1245, in __copy__
    return self.__deepcopy__(None)
  File "/home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/core.py", line 1249, in __deepcopy__
    return Booster(model_file=self)
  File "/home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/core.py", line 1175, in __init__
    _LIB.XGBoosterUnserializeFromBuffer(self.handle, ptr, length))
  File "/home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/core.py", line 190, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
xgboost.core.XGBoostError: [12:32:35] /home/sh1ng/dev/h2o4gpu/xgboost/src/objective/./regression_loss.h:89: Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0
Stack trace:
  [bt] (0) /home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x7c) [0x7f1ab89328dc]
  [bt] (1) /home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(xgboost::obj::LogisticRegression::ProbToMargin(float)+0xe7) [0x7f1ab8c1f547]
  [bt] (2) /home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(xgboost::LearnerIO::LoadModel(dmlc::Stream*)+0x1512) [0x7f1ab8a442d2]
  [bt] (3) /home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(xgboost::LearnerIO::Load(dmlc::Stream*)+0x34b) [0x7f1ab8a428bb]
  [bt] (4) /home/sh1ng/dev/.venv/lib/python3.6/site-packages/xgboost/lib/libxgboost.so(XGBoosterUnserializeFromBuffer+0x5e) [0x7f1ab893c2be]
  [bt] (5) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7f1b10891dae]
  [bt] (6) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x22f) [0x7f1b1089171f]
  [bt] (7) /home/sh1ng/dev/.venv/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(_ctypes_callproc+0x2b4) [0x7f1b10aa55c4]
  [bt] (8) /home/sh1ng/dev/.venv/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(+0x11c33) [0x7f1b10aa5c33]

@sh1ng sh1ng changed the title Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0 when underlying booster Check failed: base_score > 0.0f && base_score < 1.0f: base_score must be in (0,1) for logistic loss, got: -0 when copy underlying booster May 27, 2020
@sh1ng
Copy link
Contributor Author

sh1ng commented May 27, 2020

@trivialfis Could you have a look?

@trivialfis
Copy link
Member

Yes. Will look into it.

@trivialfis
Copy link
Member

Fixed, will back port to 1.1.1 . Thanks for filing an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants