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

Support for cuML framework classes #1

Open
vruusmann opened this issue Aug 16, 2022 · 1 comment
Open

Support for cuML framework classes #1

vruusmann opened this issue Aug 16, 2022 · 1 comment

Comments

@vruusmann
Copy link
Member

When trying to convert the model alone without preprocessing, the following error appears:

Aug 16, 2022 12:48:12 PM org.jpmml.sklearn.example.Main run
INFO: Parsing PKL..
Aug 16, 2022 12:48:12 PM org.jpmml.sklearn.example.Main run
SEVERE: Failed to parse PKL
net.razorvine.pickle.PickleException: failed to setstate()
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:395)
at net.razorvine.pickle.Unpickler.dispatch(Unpickler.java:220)
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 org.jpmml.sklearn.example.Main.run(Main.java:163)
at org.jpmml.sklearn.example.Main.main(Main.java:151)
Caused by: java.lang.NoSuchMethodException: net.razorvine.pickle.objects.ClassDict.setstate(java.lang.Integer)
at java.base/java.lang.Class.getMethod(Class.java:2108)
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:392)
... 7 more

Exception in thread "main" net.razorvine.pickle.PickleException: failed to setstate()
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:395)
at net.razorvine.pickle.Unpickler.dispatch(Unpickler.java:220)
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 org.jpmml.sklearn.example.Main.run(Main.java:163)
at org.jpmml.sklearn.example.Main.main(Main.java:151)
Caused by: java.lang.NoSuchMethodException: net.razorvine.pickle.objects.ClassDict.setstate(java.lang.Integer)
at java.base/java.lang.Class.getMethod(Class.java:2108)
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:392)
... 7 more

The model is a random forest but trained with GPU, so it is a cuml object:

RandomForestClassifier()
<class 'cuml.ensemble.randomforestclassifier.RandomForestClassifier'>

Converting the model alone without GPU as a sklearn object works without problem. 🤔



When converting model with preprocessing pipeline I got below exception:

Aug 16, 2022 12:48:32 PM org.jpmml.sklearn.example.Main run
INFO: Parsing PKL..
Aug 16, 2022 12:48:32 PM org.jpmml.sklearn.example.Main run
SEVERE: Failed to parse PKL
net.razorvine.pickle.PickleException: failed to setstate()
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:395)
at net.razorvine.pickle.Unpickler.dispatch(Unpickler.java:220)
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 org.jpmml.sklearn.example.Main.run(Main.java:163)
at org.jpmml.sklearn.example.Main.main(Main.java:151)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:393)
... 7 more
Caused by: net.razorvine.pickle.PickleException: Expected 8 attribute(s), got 9 attribute(s)
at org.jpmml.python.CustomPythonObject.createAttributeMap(CustomPythonObject.java:81)
at numpy.DType.setstate(DType.java:50)
... 12 more

Exception in thread "main" net.razorvine.pickle.PickleException: failed to setstate()
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:395)
at net.razorvine.pickle.Unpickler.dispatch(Unpickler.java:220)
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 org.jpmml.sklearn.example.Main.run(Main.java:163)
at org.jpmml.sklearn.example.Main.main(Main.java:151)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at net.razorvine.pickle.Unpickler.load_build(Unpickler.java:393)
... 7 more
Caused by: net.razorvine.pickle.PickleException: Expected 8 attribute(s), got 9 attribute(s)
at org.jpmml.python.CustomPythonObject.createAttributeMap(CustomPythonObject.java:81)
at numpy.DType.setstate(DType.java:50)
... 12 more

Originally posted by @szymoonl in jpmml/jpmml-sklearn#175 (comment)

@vruusmann
Copy link
Member Author

cuML is completelt separate from Scikit-Learn, therefore moving this issue to a new JPMML-cuML repository.

Might work on this, if the new repository gains at least some amount of attention/support.

@vruusmann vruusmann transferred this issue from jpmml/jpmml-sklearn Nov 27, 2022
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

1 participant