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 data pickling #975

Closed
rstrudel opened this issue Dec 3, 2019 · 3 comments
Closed

Support data pickling #975

rstrudel opened this issue Dec 3, 2019 · 3 comments

Comments

@rstrudel
Copy link
Contributor

rstrudel commented Dec 3, 2019

Hello,

First, thanks for adding the support of model pickling I mentionned in #957 ! I noticed that the same error occurs when trying to pickle data objects. If it is possible, it would be nice to have both model and data instances picklable.

Here is a short snippet which produces an error:

import pickle as pkl
import pinocchio as pin

model = pin.Model()
data = model.createData()
pkl.dump(data, open('data.pkl', 'wb'))

Cheers,

Robin

@jcarpent
Copy link
Contributor

jcarpent commented Dec 3, 2019

Do you really need the pickling of data? In which context?

@rstrudel
Copy link
Contributor Author

rstrudel commented Dec 3, 2019

For multiprocessing purposes I believe not being able to pickle an object is problematic. If you want to compute a function which output a Data instance (using joblib or dask for example), it will output a pickling error.

Along the same lines you cannot pass a RobotWrapper instance to a function you want to parallelize because pickling is required.

Another example is when you want to snapshot a running experiment. Pickling the current state of the robot allows you to check and debug later on.

@jcarpent
Copy link
Contributor

Solved by #998

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