Skip to content
Snippets Groups Projects
Commit b4dca517 authored by mhocke's avatar mhocke
Browse files

Fix FrameStack

Without the copy, all frames in the stack are the same,
making the FrameStack useless.
parent 5a7ff80a
No related branches found
No related tags found
No related merge requests found
Pipeline #49733 passed
...@@ -378,13 +378,12 @@ class FrameStack(gym.ObservationWrapper): ...@@ -378,13 +378,12 @@ class FrameStack(gym.ObservationWrapper):
def reset(self, **kwargs): def reset(self, **kwargs):
obs = self.env.reset(**kwargs) obs = self.env.reset(**kwargs)
# obs = super(FrameStack, self).reset()
for _ in range(self.k): for _ in range(self.k):
self.frames.append(obs) self.frames.append(obs.copy())
return self._get_obs() return self._get_obs()
def observation(self, observation): def observation(self, observation):
self.frames.append(observation) self.frames.append(observation.copy())
return self._get_obs() return self._get_obs()
def _get_obs(self): def _get_obs(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment