Unsupported structured space 'gymnasium.spaces.dict.Dict'

See original GitHub issue

I am trying to run your code with stable-baselines3 (code under examples->train_push.py), it seems like stable-baselines does not support the observation space structure defined in gymnasium. How am I suppose to solve this problem?

` Traceback (most recent call last): File “/home/wxia612/panda-gym/examples/train_push.py”, line 10, in <module> model = DDPG(policy=“MultiInputPolicy”, env=env, replay_buffer_class=HerReplayBuffer, verbose=1) File “/home/wxia612/.local/lib/python3.8/site-packages/stable_baselines3/ddpg/ddpg.py”, line 85, in init super().init( File “/home/wxia612/.local/lib/python3.8/site-packages/stable_baselines3/td3/td3.py”, line 103, in init super().init( File “/home/wxia612/.local/lib/python3.8/site-packages/stable_baselines3/common/off_policy_algorithm.py”, line 111, in init super().init( File “/home/wxia612/.local/lib/python3.8/site-packages/stable_baselines3/common/base_class.py”, line 179, in init env = self._wrap_env(env, self.verbose, monitor_wrapper) File “/home/wxia612/.local/lib/python3.8/site-packages/stable_baselines3/common/base_class.py”, line 228, in _wrap_env env = DummyVecEnv([lambda: env]) File “/home/wxia612/.local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/dummy_vec_env.py”, line 29, in init self.keys, shapes, dtypes = obs_space_info(obs_space) File “/home/wxia612/.local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/util.py”, line 67, in obs_space_info assert not hasattr(obs_space, “spaces”), f"Unsupported structured space ‘{type(obs_space)}’" AssertionError: Unsupported structured space ‘<class ‘gymnasium.spaces.dict.Dict’>’

Process finished with exit code 1 `

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
WanqingXiacommented, Nov 23, 2022

araffin

I must somehow found your solution and didn’t realise that. Thanks for sharing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I get openai.gym.spaces.Dict state updated?
You may have to use MultiInputPolicy instead of MlpPolicy as the first parameter to the PPO class when using a Dict observation space:...
Read more >
gym/dict.py at master · openai/gym - spaces - GitHub
A toolkit for developing and comparing reinforcement learning algorithms. - gym/dict.py at master · openai/gym.
Read more >
Spaces - Gym Documentation
They allow us to work with highly structured data (e.g. in the form of elements of Dict spaces) and painlessly transform them into...
Read more >
compiler_gym.spaces — CompilerGym 0.2.5 documentation
CompilerGym extends the builtin gym spaces to better describe the observation spaces available to compilers. Additional spaces: Commandline. Dict. Discrete.
Read more >
stable_baselines3.common.env_checker - Stable Baselines3
"However, you can convert it to a Dict observation space " "(cf. https://github.com/openai/gym/blob/master/gym/spaces/dict.py). " "which is supported by SB3 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found