onnxmltools
onnxmltools copied to clipboard
LightGBM conversion to ONNX error
Hi
I am facing below error ValueError: No proper operator name found for '<class 'lightgbm.basic.Booster'>' while converting my LGBMClassifier model to ONNX. The model was trained using LightGBM.
Python - 3.7.1 installed through Anaconda on Win 10 used convert_lightgbm onnx_model = onnxmltools.convert_lightgbm(lgb_model,initial_types=initial_type)
also we used convert_sklearn to see if this works onnx_model = onnxmltools.convert_sklearn(lgb_model,initial_types=initial_type) RuntimeError: Unable to find a shape calculator for type '<class 'lightgbm.basic.Booster'>'.
Any thoughts on this error?
Thanks Su
Ironically I had the same question. The documentation is not particularly clear in the case of LightGBM
Hello Su and @MotoRZR, sorry for any difficulties you've had with the conversion process! In the convert_sklearn case, have you registered the lightgbm converters to be used with skl2onnx? Which version of onnxmltools/skl2onnx are you using?
With https://github.com/onnx/onnxmltools/pull/329 merged, you might be able to convert a Booster instance to ONNX now. Try with the master branch, and let me know of any issues.
@vinitra I am facing the same issue with lightgbm to onnx coversion
RuntimeError: Options ['nocl'] are not registerd for model 'LGBMClassifier'.
since this issue is old I thought it got solved 1.5.1 but it still exist.
I am having following versions of libraries. onnxmltools (1.7.0) INSTALLED: 1.7.0 (latest)
skl2onnx (1.7.0) INSTALLED: 1.7.0 (latest)