jpmml / jpmml-lightgbm

Java library and command-line application for converting LightGBM models to PMML
GNU Affero General Public License v3.0
174 stars 58 forks source link

Support for LightGBM 4.X #58

Closed vruusmann closed 1 year ago

vruusmann commented 2 years ago

As reported by an end user, the current GitHub HEAD version of LightGBM is already writing out the version header as version=v4, which causes the JPMML-LightGBM library to crash with an exception:

java.lang.IllegalArgumentException: Version v4 is not supported
        at org.jpmml.lightgbm.GBDT.load(GBDT.java:92)
        at org.jpmml.lightgbm.LightGBMUtil.loadGBDT(LightGBMUtil.java:52)
        at org.jpmml.lightgbm.LightGBMUtil.loadGBDT(LightGBMUtil.java:44)
        at org.jpmml.lightgbm.example.Main.run(Main.java:146)
        at org.jpmml.lightgbm.example.Main.main(Main.java:136)

Reportedly, this exception can be temporarily "resolved" by opening the model text file in a text editor, and replacing version=v4 with version=v3.