Closed luigiberducci closed 9 months ago
Apologies I never saw this, but I will look into it, my guess is it is exactly as you describe and shouldn't be a hard fix. As said in the README SuperSuit is going to be deprecated in favor of vector wrappers the way Gymnasium currently does it (in the plans for the next year, will take a good amount of testing and such but just FYI)
Ran your code locally and did some searching through the tests and I see the problem, you need to call pettingzoo_env_to_vec_env_v1
first before using concat_vec_envs_v1
, but this is something which should be warned when you do wrap the environment in the first place, I will see if it's possible to add that as a feature so future users won't be confused like you were.
Here's a modified version of your script which works successfully:
from pettingzoo.butterfly import pistonball_v6
import supersuit as ss
env = pistonball_v6.parallel_env()
env = ss.pettingzoo_env_to_vec_env_v1(env)
envs = ss.concat_vec_envs_v1(env, num_vec_envs=2, num_cpus=0)
envs.reset()
For reference, I searched for concat_vec_envs_v1 and saw it used in a file with pettingzoo imported as well, and found this example usage in the tests: https://github.com/Farama-Foundation/SuperSuit/blob/master/test/test_vector/test_vector_dict.py#L82
I am trying to vectorize a multi-agent environment with concat_vec_envs_v1
and facing the following error:
It looks the class SingleVecEnv only returns observation, instead of a tuple (observation, info). In the code, there is also a comment about it:
I am wondering if I am not supposed to vectorize the environment in this way. Hope you can give me some insight!
Thanks for your help!