You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a similar issue to Issue #220, however mine is not being resolved by using ss.flatten_v0().
I'm using the latest current versions of stable-baselines3==2.1.0a0, pettingzoo==1.23.1, supersuit==3.8.1 and gymnasium==0.28.1. I have also tried with stable-baselines3==2.0.0 and had the same issue.
Traceback (most recent call last): File "C:\dev\repo\test-supersuit-baseline3-pettingzoo-parallel-env\main_dummy.py", line 17, in <module> model.learn(total_timesteps=10_000) File "C:\Users\adamcc\AppData\Roaming\Python\Python311\site-packages\stable_baselines3\ppo\ppo.py", line 308, in learn return super().learn( ^^^^^^^^^^^^^^ File "C:\Users\adamcc\AppData\Roaming\Python\Python311\site-packages\stable_baselines3\common\on_policy_algorithm.py", line 259, in learn continue_training = self.collect_rollouts(self.env, callback, self.rollout_buffer, n_rollout_steps=self.n_steps) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\adamcc\AppData\Roaming\Python\Python311\site-packages\stable_baselines3\common\on_policy_algorithm.py", line 168, in collect_rollouts obs_tensor = obs_as_tensor(self._last_obs, self.device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\adamcc\AppData\Roaming\Python\Python311\site-packages\stable_baselines3\common\utils.py", line 487, in obs_as_tensor raise Exception(f"Unrecognized type of observation {type(obs)}")Exception: Unrecognized type of observation <class 'tuple'>Process finished with exit code 1Exception: Unrecognized type of observation <class 'tuple'>
If I set a breakpoint in stable_baselines3 class on_policy_algorithm.py at line 168, I see that self._last_obs is being set to the tuple of observation and info that is being returned by the ParallelEnv reset() method. obs_as_tensor() is expecting a np.ndarray.
Have I got something wrong or is there a compatibility issue here somewhere?
Thanks,
Adam
The text was updated successfully, but these errors were encountered:
To my knowledge, this has been fixed with #226 (I was getting the same issue, it's because they expect only an observation whereas by default PettingZoo and Gymnasium return an observation and info)
Hi,
I'm having a similar issue to Issue #220, however mine is not being resolved by using ss.flatten_v0().
I'm using the latest current versions of stable-baselines3==2.1.0a0, pettingzoo==1.23.1, supersuit==3.8.1 and gymnasium==0.28.1. I have also tried with stable-baselines3==2.0.0 and had the same issue.
I have adapted @PieroMacaluso's dummy project from Issue #169 to reproduce the issue: https://github.com/adam-crowther/test-supersuit-baseline3-pettingzoo-parallel-env
The ParallelEnv looks like this:
And is executed like this:
When I execute I get this error:
If I set a breakpoint in stable_baselines3 class
on_policy_algorithm.py
at line 168, I see thatself._last_obs
is being set to the tuple of observation and info that is being returned by the ParallelEnv reset() method.obs_as_tensor()
is expecting anp.ndarray
.Have I got something wrong or is there a compatibility issue here somewhere?
Thanks,
Adam
The text was updated successfully, but these errors were encountered: