About the conflict between Stable Baselines and PantheonRL
skydvn opened this issue · 2 comments
Dear authors,
I run the examples of pettingzoo on colab. However I still face these problems.
2
Using cpu device
Wrapping the env with a Monitor
wrapper
Wrapping the env in a DummyVecEnv.
AssertionError Traceback (most recent call last)
in
10 print(env.n_players)
11 for i in range(env.n_players - 1):
---> 12 partner = OnPolicyAgent(PPO('MlpPolicy', env.getDummyEnv(i), verbose=1))
13
14 # The second parameter ensures that the partner is assigned to a certain
5 frames
/usr/local/lib/python3.8/dist-packages/stable_baselines3/common/vec_env/util.py in obs_space_info(obs_space)
65 subspaces = {i: space for i, space in enumerate(obs_space.spaces)}
66 else:
---> 67 assert not hasattr(obs_space, "spaces"), f"Unsupported structured space '{type(obs_space)}'"
68 subspaces = {None: obs_space}
69 keys = []
AssertionError: Unsupported structured space '<class 'gymnasium.spaces.dict.Dict'>'
Hi! Thanks for letting us know about this issue. The reason for this behavior is a change in PettingZoo's requirements since it now uses OpenAI's gym version 0.27.0 whereas SB3 (and PantheonRL) use 0.21.0. I'm in the process of writing a patch for this, which will be out in a few days.
Ok, I think the latest commits should resolve this issue!