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

Use CloudpickleWrapper to send specs in SubprocVecEnv #1028

Merged
merged 1 commit into from
Nov 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
SubprocVecEnv uses CloudpickleWrapper to send specs
  • Loading branch information
iamhatesz committed Nov 5, 2019
commit 3c022a6dc3a7ae86d655ce85f49ee0927e2e106d
4 changes: 2 additions & 2 deletions baselines/common/vec_env/subproc_vec_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def step_env(env, action):
remote.close()
break
elif cmd == 'get_spaces_spec':
remote.send((envs[0].observation_space, envs[0].action_space, envs[0].spec))
remote.send(CloudpickleWrapper((envs[0].observation_space, envs[0].action_space, envs[0].spec)))
else:
raise NotImplementedError
except KeyboardInterrupt:
Expand Down Expand Up @@ -68,7 +68,7 @@ def __init__(self, env_fns, spaces=None, context='spawn', in_series=1):
remote.close()

self.remotes[0].send(('get_spaces_spec', None))
observation_space, action_space, self.spec = self.remotes[0].recv()
observation_space, action_space, self.spec = self.remotes[0].recv().x
self.viewer = None
VecEnv.__init__(self, nenvs, observation_space, action_space)

Expand Down