Farama-Foundation / SuperSuit

A collection of wrappers for Gymnasium and PettingZoo environments (being merged into gymnasium.wrappers and pettingzoo.wrappers
Other
441 stars 56 forks source link

concat_vec_envs_v1 broken due to ProcConcatVec deprecation #217

Closed elliottower closed 1 year ago

elliottower commented 1 year ago

Code to reproduce:

from pettingzoo.butterfly import pistonball_v6
import supersuit as ss

env = pistonball_v6.parallel_env(n_pistons=20, time_penalty=-0.1, continuous=True, random_drop=True, random_rotate=True, ball_mass=0.75, ball_friction=0.3, ball_elasticity=1.5, max_cycles=125)

env = ss.color_reduction_v0(env, mode='B')
env = ss.resize_v1(env, x_size=84, y_size=84)
env = ss.frame_stack_v1(env, 3)

#
env = ss.pettingzoo_env_to_vec_env_v1(env)
env = ss.concat_vec_envs_v1(env, 8, num_cpus=4, base_class='stable_baselines3')

Error message:

Traceback (most recent call last):
  File "/mnt/d/GitHub/PettingZoo/sb3_train.py", line 14, in <module>
    env = ss.concat_vec_envs_v1(env, 8, num_cpus=4, base_class='stable_baselines3')
  File "/home/elliot/anaconda3/envs/pettingzoo/lib/python3.9/site-packages/supersuit/vector/vector_constructors.py", line 64, in concat_vec_envs_v1
    vec_env = MakeCPUAsyncConstructor(num_cpus)(*vec_env_args(vec_env, num_vec_envs))
  File "/home/elliot/anaconda3/envs/pettingzoo/lib/python3.9/site-packages/supersuit/vector/constructors.py", line 35, in constructor
    return ProcConcatVec(
  File "/home/elliot/anaconda3/envs/pettingzoo/lib/python3.9/site-packages/supersuit/vector/multiproc_vec.py", line 121, in __init__
    raise NotImplementedError(
NotImplementedError: The wrapper ProcConcatVec is temporarily depreciated whilst it is being debugged. Please refer to https://github.com/Farama-Foundation/SuperSuit/pull/165 for more information, or to contact the devs in regard to this.
Exception ignored in: <function ProcConcatVec.__del__ at 0x7fc512945ee0>
Traceback (most recent call last):
  File "/home/elliot/anaconda3/envs/pettingzoo/lib/python3.9/site-packages/supersuit/vector/multiproc_vec.py", line 226, in __del__
    for pipe in self.pipes:
AttributeError: 'ProcConcatVec' object has no attribute 'pipes'
ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['python', '/mnt/d/GitHub/PettingZoo/sb3_train.py']' command failed.  (See above for error)

Versions: PettingZoo 1.23.1 SuperSuit 3.8.0

elliottower commented 1 year ago

Fixed in #219