ProMP icon indicating copy to clipboard operation
ProMP copied to clipboard

Why Pickle Environment

Open 0xJchen opened this issue 3 years ago • 0 comments

Hi, Jonas. Thanks for sharing this great project. I am little confused on why we pickle the environment when creating the process in the MetaParallelEnvExecutor:

        self.ps = [
             Process(target=worker, args=(work_remote, remote, pickle.dumps(env), envs_per_task, max_path_length, seed))
             for (work_remote, remote, seed) in zip(self.work_remotes, self.remotes, seeds)]  # Why pass work remotes?

and then unpickle it in the process:

envs = [pickle.loads(env_pickle) for _ in range(n_envs)]

Why we do not just initialize the environment in the process worker, which eliminates the code for pickle and unpicke.

0xJchen avatar Jan 24 '22 13:01 0xJchen