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

Breaking big initializer methods into manageable-size segments #16

Open
TPF2017 opened this issue Aug 4, 2021 · 5 comments
Open

Breaking big initializer methods into manageable-size segments #16

TPF2017 opened this issue Aug 4, 2021 · 5 comments

Comments

@TPF2017
Copy link

TPF2017 commented Aug 4, 2021

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)

@vruusmann
Copy link
Member

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.

@TPF2017
Copy link
Author

TPF2017 commented Aug 4, 2021

jar.zip
Do you mean this file?

@vruusmann
Copy link
Member

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.

@vruusmann vruusmann changed the title Failing to transform a pmml file to executable uber-JAR file Breaking big initializer methods into manageable-size segments Aug 4, 2021
@vruusmann
Copy link
Member

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

@TPF2017
Copy link
Author

TPF2017 commented Aug 4, 2021

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 !!

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

2 participants