-
Notifications
You must be signed in to change notification settings - Fork 179
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
Algorithms cannot be pickle'd #425
Comments
Is there any update on this? I am facing the same error with: Python 3.8 |
There is no obvious reason to pickle objects like import daal4py as d4p
import numpy as np
import pickle
x = np.random.uniform(size=(1000, 8))
alg = d4p.qr()
res = alg.compute(x)
p = pickle.dumps(res)
loaded_res = pickle.loads(p)
print((loaded_res.matrixQ == res.matrixQ).all(), (loaded_res.matrixR == res.matrixR).all()) Output: import daal4py as d4p
import numpy as np
from sklearn.datasets import make_classification
import pickle
x, y = make_classification()
alg = d4p.svm_training()
res = alg.compute(x, y.reshape((y.shape[0], 1)))
p = pickle.dumps(res)
loaded_res = pickle.loads(p)
print((loaded_res.model.SupportVectors == res.model.SupportVectors).all()) Output |
What do you mean? Two people asked for the feature. Why is that not obvious? A very obvious reason is when you write a generic code accepting an algorithm to call, e.g. if the algorithm is a n argument. You cannot let a remote worker execute such a function if the algorithm cannot be pickle'd. |
Even worse: the current lack of pickle support makes any class/object with a algorithm member unpickle'able. |
Describe the bug
Exception is raised when pickling algorithm objects.
To Reproduce
Expected behavior
It should create a pickle buffer
Output/Screenshots
Environment:
The text was updated successfully, but these errors were encountered: