SubprocVecEnv not working
See original GitHub issueI’m trying to use SubprocVecEnv to initialize multiple instances of one environment to use in ACKTR and A2C, however, there seem to be problems with SubprocVecEnv. Following this code, the following happens:
def make_env():
env = gym.make('Test-v0')
return env
env = gym.make('Test-v0') #Works, env initialization message is printed
env = make_env() #Works, env initialization message is printed
env = SubprocVecEnv([make_env]) #Doesn't work, code gets stuck
Meaning, env creation through the function works fine, the same goes for manual creation, however, when SubprocVecEnv is called the code gets stuck, nothing seems to happen and it doesn’t stop running, nor does the environment get created.
I tried calling manually env = SubprocVecEnv([make_env])
and it yields a strange error:
env = SubprocVecEnv([make_env]) Traceback (most recent call last):
File “<ipython-input-8-427e992f56b1>”, line 1, in <module> env = SubprocVecEnv([make_env])
File “c:\users\x\baselines\baselines\common\vec_env\subproc_vec_env.py”, line 58, in init observation_space, action_space = self.remotes[0].recv()
File “D:\Programs\Anaconda3\lib\multiprocessing\connection.py”, line 250, in recv buf = self._recv_bytes()
File “D:\Programs\Anaconda3\lib\multiprocessing\connection.py”, line 321, in _recv_bytes raise EOFError
EOFError
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9
Top GitHub Comments
It does use
SubprocVecEnv
, I just make a dummy call tocustom_atari_env
before making a call to the originalmake_atari_env
.The call to
custom_atari_env
I think sets something up in the background and themake_atari_env
does not throw an error after that.@Coronon could you provide the code you are running and error stacktrace? The baselines code has changed quite a bit since the issue was opened; it would be helpful to have a recent stacktrace.