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

Why Pickle Environment #14

Open
0xJchen opened this issue Jan 24, 2022 · 0 comments
Open

Why Pickle Environment #14

0xJchen opened this issue Jan 24, 2022 · 0 comments

Comments

@0xJchen
Copy link

0xJchen commented Jan 24, 2022

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.

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

1 participant