From 5ad5a5835091c47d83b61901f8801fd6c9481909 Mon Sep 17 00:00:00 2001 From: shadiendrawis Date: Sun, 6 Oct 2019 18:14:21 +0300 Subject: [PATCH] fix atari stack overflow (#412) --- rl_coach/environments/gym_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rl_coach/environments/gym_environment.py b/rl_coach/environments/gym_environment.py index 5946aea..bb5b399 100644 --- a/rl_coach/environments/gym_environment.py +++ b/rl_coach/environments/gym_environment.py @@ -459,7 +459,7 @@ class GymEnvironment(Environment): def _restart_environment_episode(self, force_environment_reset=False): # prevent reset of environment if there are ale lives left if (self.is_atari_env and self.env.unwrapped.ale.lives() > 0) \ - and not force_environment_reset: + and not force_environment_reset and self.env.env._elapsed_steps < self.env.env._max_episode_steps: self.step(self.action_space.default_action) else: self.state = self.env.reset()