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

cannot import name 'FEATURE_IMPORTANCE_TYPE_MAPPER' from 'lightgbm.basic' #654

Open
nitish20899 opened this issue Sep 26, 2023 · 5 comments

Comments

@nitish20899
Copy link

nitish20899 commented Sep 26, 2023

This issue arises while attempting to utilize onnxmltools.convert.convert_lightgbm. It invokes the method at /opt/conda/lib/python3.8/site-packages/onnxmltools/convert/lightgbm/operator_converters/LightGbm.py:267, specifically within dump_booster_model(self, num_iteration, start_iteration, importance_type, verbose). Here is the snippet related to the issue:

265 if getattr(self, 'is_mock', False):
266     return self.dump_model(), None
--> 267 from lightgbm.basic import (
268     _LIB, FEATURE_IMPORTANCE_TYPE_MAPPER, _safe_call,

The problem stems from the fact that it is attempting to call FEATURE_IMPORTANCE_TYPE_MAPPER, which has been modified to _FEATURE_IMPORTANCE_TYPE_MAPPER as per the following issue: issue link.

It appears that the code in onnxmltools has not been updated to reflect this change, leading to the current discrepancy.

@xadupre
Copy link
Collaborator

xadupre commented Oct 2, 2023

CI now inlcudes lightgbm 4 so this should be fixed if you install onnxmltools from github.

@yungcero
Copy link
Contributor

yungcero commented Nov 16, 2023

Commenting just because I just got this error too when running the light gbm converter for the first time today (EDIT: but got it working when installing from github). When do you think this fix will be pushed to the pip repo? @xadupre

@xadupre
Copy link
Collaborator

xadupre commented Nov 17, 2023

The plan is to release before 12/15.

@ElvisWai
Copy link

I'm experiencing the same issue. Please release the latest version as soon as possible.

@xadupre
Copy link
Collaborator

xadupre commented Dec 15, 2023

Hi sorry for the delay. skl2onnx was released this week. I did not have time to complete the PR #670 to fix xgboost converter for xgboost >= 2. It should be done on Monday.

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

4 participants