-
Notifications
You must be signed in to change notification settings - Fork 241
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
Unable to export code from XGBoost 1.7.5 models #581
Comments
meet the same error |
Encountering the same error. This is a breaking change for my pipeline. Any ideas here? |
Yep, it is breaking for me too, I hope for some updates from the developer... |
Taking a look at Maybe this model field has been renamed or removed, I will check it out and update this issue. |
Debugging into If the # booster is already trained
temp_file = "temp.ubj"
booster.save_model(temp_file)
xgbclf = xgb.XGBClassifier()
xgbclf.load_model(temp_file)
os.remove(temp_file)
xgbclf.base_score = 0 # workaround
c_code = m2c.export_to_c(xgbclf)
py_code = m2c.export_to_python(xgbclf) |
This works for me. Thanks! |
I'm using the following code to generate Python code from a XGBoost (
bst
is a previously trained XGBoost object)This worked fine with XGBoost 1.7.1, but when I updated to 1.7.5, I received the following error:
Does
m2cgen
have support for the latest XGBoost version or do I have something to tweak inside the model to make it work like before?Thanks
The text was updated successfully, but these errors were encountered: