-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Issue of loading a Python trained LGB regression model using C-API for prediction. #4021
Comments
I have the same problem. using python to train model and predict using c api for regression task. It's a Bug? |
@BladeCoda @JackYangzg Thanks for using LightGBM. I think this is related to #3778. If the model is produced with the released python package (version 3.1.1), and loaded by C_API from latest master branch, there can be a problem. Could you please try if the fix in #4056 resolves your problems? |
@BladeCoda The above-mentioned fix is in |
This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM! |
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. |
Hello, I get a issue while using C API to load a LGB regression model which is trained in python(python 3.6, lightgbm 3.1.1).
The result predicted by C API loaded model is greatly differs from which is directly predicted by python library.
Here is how I train the regression model and do further prediction in python (brief code):
The result predicted by the python loaded model is just fine. However, when I load this saved model using C-API for prediction, the predicted result is totally not as my expected. Here is the brief code about how I load the model for prediction:
In fact, I already successfully test a classification task using C-API loaded python model, and the predicted result is corrected. But when I use the same code to load a regression model, it goes wrong.
Is there something I omitted to load a python trained regression model using C-API?
The text was updated successfully, but these errors were encountered: