openai / mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Other
2.87k stars 815 forks source link

Facilitating pickles #631

Open rojas70 opened 3 years ago

rojas70 commented 3 years ago

It seems one is not able to pickle mujoco environments. This may be partially due to the underlying mujoco black-box classes that we don't have access to, and require specific initializations (e.g.: MjSim object).

I wonder if the team could assist in providing a fix. It might involve overriding specific pickling / unpickling protocol for mujoco environments, such that during the pickling process all mujoco-based objects (sim, renderer, etc.) are destroyed -- i.e.: only primitive attributes are saved. During unpickling, these objects would then need to be re-instantiated