-
Notifications
You must be signed in to change notification settings - Fork 11
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
Can't pickle ... #11
Comments
Hi Adrian, thanks for the issue and glad Just as a quick first check you could try switching this line at the top of from joblib.externals import cloudpickle
# to -->
import dill as cloudpickle and see if everything runs for you? |
Hi @jcmgray, thanks for getting in touch. Unfortunately, your suggested change did not resolve the issue but raise the following error:
Any thoughts on this? |
OK that seems to be a separate problem - the The main problem is in fact not to do with pickling the function (what As an easier workaround than your current, you could simply pickle the return yourself: return dill.dumps(botorch.models.SingleTaskGP(x, y)) then unpickle on the other end. And it might be nice to have this as a separate picklelib options as well. |
Hi @jcmgray, I see. Is there a particular reason why you are using both In any case, am using your suggested solution at them moment as a workaround, which is indeed much smarter than simply throwing away the objects ;-) Thanks a lot for your help! Much appreciated! |
The reasoning was I think as follows:
This logic might not be necessary anymore, & I defo agree it would nice to be able to be able to customize which picklers are used. I can try and add this at some point (unless you want to!), but it might not be immediately. |
Hi @jcmgray, I'm currently using your awesome package to automate my experiments and noticed a problem related to pickling certain data types. While the cloudpickle backend of joblib should work fine to handle, for example, lambda functions, I get an error when working with certain modules based on torch.
Here is a minimal example:
It produces the following error:
Tested with
Python 3.7.3
andAfter a short search, I found this related post: cornellius-gp/gpytorch#907
A potential solution seems to be using
dill
instead ofpickle
. Do you think this option can be added to xyzpy?For now, my workaround is to remove all problematic variables from the object returned by function to be evaluated after all internal computations have been completed. However, it would be much nicer, of course, if the objects could be naturally handled by xyzpy.
Kind regards,
Adrian
The text was updated successfully, but these errors were encountered: