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

Compatibility with Joblib 1.2(.0) #19

Closed
vruusmann opened this issue Sep 28, 2022 · 2 comments
Closed

Compatibility with Joblib 1.2(.0) #19

vruusmann opened this issue Sep 28, 2022 · 2 comments

Comments

@vruusmann
Copy link
Member

vruusmann commented Sep 28, 2022

I'm sorry for bumping this old and closed issue up, but strangely I got the same error now, which has never been occurred to me before. To make sure, I ran the LightGBM example from your blog entry. It resulted the same error.

Standard output is empty
Standard error:
Exception in thread "main" net.razorvine.pickle.InvalidOpcodeException: invalid pickle opcode: 0
	at net.razorvine.pickle.Unpickler.dispatch(Unpickler.java:366)
	at org.jpmml.python.CustomUnpickler.dispatch(CustomUnpickler.java:31)
	at org.jpmml.python.PickleUtil$1.dispatch(PickleUtil.java:64)
	at net.razorvine.pickle.Unpickler.load(Unpickler.java:109)
	at org.jpmml.python.PickleUtil.unpickle(PickleUtil.java:85)
	at com.sklearn2pmml.Main.run(Main.java:78)
	at com.sklearn2pmml.Main.main(Main.java:66)

Here is my environment:

python-3.10.5.amd64

sklearn2pmml         0.86.3
scikit-learn         1.1.2
pandas               1.5.0
sklearn-pandas       2.2.0
joblib               1.2.0
numpy                1.23.3

java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)

Is there anything that I can do to investigate further? Thank you

EDIT:
Reverting joblib to 1.1.0 solves the problem.

Originally posted by @denmase in jpmml/sklearn2pmml#8 (comment)

@agude-sq
Copy link

We were getting the same error with joblib == 1.2.0 and again downgrading to 1.1.0 solved it.

@vruusmann
Copy link
Member Author

The fix is included in SkLearn2PMML version 0.87.0 (and newer).

The unexpected zero byte inside Joblib 1.2.0 pickles is related to "padding for efficient Numpy array memory-mapping functionality", as detailed in the closing commit (referenced above).

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