jpmml/jpmml-transpiler

Breaking big initializer methods into manageable-size segments

TPF2017 opened this issue · 5 comments

When I run
java -Xms4g -Xmx4g -jar jpmml-transpiler-executable-1.1-SNAPSHOT.jar --pmml-input LambdaRank.pmml --jar-output LambdaRank.pmml.jar

I Got

java.io.IOException
at org.jpmml.codemodel.CompilerUtil.compile(CompilerUtil.java:89)
at org.jpmml.codemodel.CompilerUtil.compile(CompilerUtil.java:45)
at org.jpmml.transpiler.TranspilerUtil.compile(TranspilerUtil.java:75)
at org.jpmml.transpiler.Main.run(Main.java:116)
at org.jpmml.transpiler.Main.main(Main.java:99)

Please provide more information about the compilation error.

You should have a half-baked JAR file somewhere, which contains a problematic Java source code file. You can parse it yourself, or you can give it to me.

jar.zip
Do you mean this file?

Do you mean this file?

Yes!

You can extract the enclosed PMML$750029115.java Java source code file, and compile it using the command-line javac.exe tool in order to see the real compilation problem:

$ javac -cp pmml-evaluator-example-executable-1.6-SNAPSHOT.jar PMML\$750029115.java 

The error message is:

PMML$750029115.java:20257: error: code too large
        private static void initScores$892555958(DataInputStream dataInput)
                            ^
PMML$750029115.java:20266: error: code too large
        private static void initMethods$892555958() {
                            ^
2 errors

In short, JPMML-Transpiler is generating static initializer methods which exceed some JLS/JVM limits. The root cause is that your GBDT model contains too many child decision tree models.

You should try to limit n_estimators to 1000 for starters.

You can extract the enclosed PMML$750029115.java Java source code file, and compile it using the command-line javac.exe tool

FYI, you can satisfy all import requirements by adding the JPMML-Evaluator uber-JAR file to compiler classpath:
https://github.com/jpmml/jpmml-evaluator/releases

You can extract the enclosed PMML$750029115.java Java source code file, and compile it using the command-line javac.exe tool

FYI, you can satisfy all import requirements by adding the JPMML-Evaluator uber-JAR file to compiler classpath:
https://github.com/jpmml/jpmml-evaluator/releases

Thanks a lot !!