From 9e59d1960e0c1ff08991fa5f5ae239a605bbb2bd Mon Sep 17 00:00:00 2001 From: Itai Caspi Date: Wed, 20 Dec 2017 13:09:41 +0200 Subject: [PATCH] bug fix for dumping gifs from doom --- environments/doom_environment_wrapper.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/environments/doom_environment_wrapper.py b/environments/doom_environment_wrapper.py index 997a067..c4a06ac 100644 --- a/environments/doom_environment_wrapper.py +++ b/environments/doom_environment_wrapper.py @@ -146,6 +146,11 @@ class DoomEnvironmentWrapper(EnvironmentWrapper): def _preprocess_observation(self, observation): if observation is None: return None + + # for the last step we get no new observation, so we shouldn't preprocess it + if self.done: + return observation + # move the channel to the last axis observation = np.transpose(observation, (1, 2, 0)) return observation