From df21e1dc3f0475b22ccc22d31af2c24cb13a8f19 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 25 Jun 2022 17:49:46 +0200 Subject: [PATCH] Fixed reference to gym.spaces --- sb3_trl/trl_pg/trl_pg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sb3_trl/trl_pg/trl_pg.py b/sb3_trl/trl_pg/trl_pg.py index 34b2c83..d217f89 100644 --- a/sb3_trl/trl_pg/trl_pg.py +++ b/sb3_trl/trl_pg/trl_pg.py @@ -439,7 +439,7 @@ class TRL_PG(OnPolicyAlgorithm): # Rescale and perform action clipped_actions = actions # Clip the actions to avoid out of bound error - if isinstance(self.action_space, gym.spaces.Box): + if isinstance(self.action_space, spaces.Box): clipped_actions = np.clip( actions, self.action_space.low, self.action_space.high) @@ -455,7 +455,7 @@ class TRL_PG(OnPolicyAlgorithm): self._update_info_buffer(infos) n_steps += 1 - if isinstance(self.action_space, gym.spaces.Discrete): + if isinstance(self.action_space, spaces.Discrete): # Reshape in case of discrete action actions = actions.reshape(-1, 1)