Unexpected observation shape

I have a boid flocking environment. I have made a model that works with 3 boids. I have had to reshape the 1D array actions, obs, to 2D to pass other than that its ok.

Now I am training it for 10 boids. The training goes well but the I get this error when testing, though nothing seems to be the problem. I reshape it as well to pass 10 actions.

ValueError: Error: Unexpected observation shape (40,) for Box environment, please use (12,) or (n_env, 12) for the observation shape.

I am using PPO from SB3 in OpenAI Gym.

Action and observation space:

min_action = np.array([-5, -5] * len(self.agents), dtype=np.float32) max_action = np.array([5, 5] * len(self.agents), dtype=np.float32) self.action_space = spaces.Box(low=min_action, high=max_action, dtype=np.float32) min_obs = np.array([-np.inf, -np.inf, -2.5, -2.5] * len(self.agents), dtype=np.float32) max_obs = np.array([np.inf, np.inf, 2.5, 2.5] * len(self.agents), dtype=np.float32) self.observation_space = spaces.Box(low=min_obs, high=max_obs, dtype=np.float32)

submitted by /u/Hooooman101
[link] [comments]

Leave a Reply

The Future Is A.I. !
To top