onnxmltools icon indicating copy to clipboard operation
onnxmltools copied to clipboard

ImportError: cannot import name 'hummingbird_installed'

Open waiyujack opened this issue 3 years ago • 5 comments

There was an error when I tried to import convert_lightgbm. See code below:

import lightgbm
import onnxmltools
import onnx
import os

print("onnx: ", onnx.__version__)
print("onnxmltools: ", onnxmltools.__version__)
print("lightgbm: ", lightgbm.__version__)
onnx:  1.8.0
onnxmltools:  1.7.0
lightgbm:  3.1.0

from onnxmltools.convert.lightgbm.operator_converters.LightGbm import convert_lightgbm

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-6-b77a20ee8474> in <module>
----> 1 from onnxmltools.convert.lightgbm.operator_converters.LightGbm import convert_lightgbm

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/onnxmltools/convert/lightgbm/__init__.py in <module>
      5 # --------------------------------------------------------------------------
      6 
----> 7 from .convert import convert

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/onnxmltools/convert/lightgbm/convert.py in <module>
     10 import onnx
     11 from ..common._topology import convert_topology
---> 12 from ..common.utils import hummingbird_installed
     13 from ._parse import parse_lightgbm, WrappedBooster
     14 

ImportError: cannot import name 'hummingbird_installed'

waiyujack avatar Nov 30 '20 13:11 waiyujack

I think the latest onnxconveter-common package (1.7.0) does not contain the hummingbird_installed() function.

waiyujack avatar Nov 30 '20 15:11 waiyujack

For the time being, I suggest installing onnxconverter-common from source. We should release a new version soon including this function.

xadupre avatar Jan 06 '21 17:01 xadupre

Will be fixed by #468.

xadupre avatar Jun 14 '21 17:06 xadupre

Did you try recently?

xadupre avatar Aug 24 '21 08:08 xadupre

@xadupre Yes, this's fine using the latest version. And by the way, this is Jack you are helping me with the lightgbm conversion discrepencies.

waiyujack avatar Aug 24 '21 09:08 waiyujack