Skip to content

Commit

Permalink
SubprocVecEnv uses CloudpickleWrapper to send specs (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhatesz authored and pzhokhov committed Nov 8, 2019
1 parent 665b888 commit 391811d
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 391811d

Please sign in to comment.