Converting OpenAI vectorized env to stable baselines vectorized env?
See original GitHub issueI am trying to take an openai baselines environment (vectorized procgen env) and convert it to a stable baselines vectorized environment. Below is my naive attempt. I get the following error that it expects a function, but I am not sure how to resolve the issue. Any help is appreciated.
from procgen import ProcgenEnv
from baselines.common.vec_env import (
VecExtractDictObs,
VecMonitor,
VecFrameStack,
VecNormalize
)
venv = ProcgenEnv(num_envs=200, env_name="coinrun")
venv = VecExtractDictObs(venv, "rgb")
venv = VecMonitor(venv=venv, filename=None, keep_buf=200,)
venv = VecNormalize(venv=venv, ob=False)
venv = DummyVecEnv(venv)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-36f973b40ef0> in <module>
16 venv = VecNormalize(venv=venv, ob=False)
17
---> 18 venv = DummyVecEnv(venv)
~/Documents/drl/research/venv_proc/lib/python3.6/site-packages/stable_baselines/common/vec_env/dummy_vec_env.py in __init__(self, env_fns)
18
19 def __init__(self, env_fns):
---> 20 self.envs = [fn() for fn in env_fns]
21 env = self.envs[0]
22 VecEnv.__init__(self, len(env_fns), env.observation_space, env.action_space)
TypeError: 'VecNormalize' object is not iterable```
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:17
Top Results From Across the Web
Vectorized Environments - Stable Baselines - Read the Docs
Creates a simple vectorized wrapper for multiple environments, calling each environment in sequence on the current Python process. This is useful for ...
Read more >Examples — Stable Baselines 2.10.3a0 documentation
Following example demonstrates reading parameters, modifying some of them and loading them to model by implementing evolution strategy for solving CartPole-v1 ...
Read more >Vectorized Environments - Stable Baselines3 - Read the Docs
Creates a simple vectorized wrapper for multiple environments, calling each environment in sequence on the current Python process. This is useful for ...
Read more >Stable Baselines Documentation
Vectorized Environments are a method for multiprocess training. Instead of training an RL agent on 1 environment,.
Read more >Vectorized Environments - Stable Baselines - Read the Docs
Vectorized Environments are a method for multiprocess training. Instead of training an RL agent on 1 environment, it allows us to train it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this already exist: https://github.com/openai/gym/blob/master/gym/wrappers/filter_observation.py
Fixed in SB3: https://github.com/DLR-RM/stable-baselines3/pull/311