Skip to content

Commit

Permalink
Revert "Revert "Revert "Optimize Atari envs"""
Browse files Browse the repository at this point in the history
This reverts commit 8f62c0a.
  • Loading branch information
tlbtlbtlb committed Mar 28, 2017
1 parent 8f62c0a commit f719298
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gym/envs/atari/atari_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, game='pong', obs_type='ram', frameskip=(2, 5), repeat_action_
self._seed()

(screen_width, screen_height) = self.ale.getScreenDims()
self._buffer = np.empty((screen_height, screen_width, 3), dtype=np.uint8)
self._buffer = np.empty((screen_height, screen_width, 4), dtype=np.uint8)

self._action_set = self.ale.getMinimalActionSet()
self.action_space = spaces.Discrete(len(self._action_set))
Expand Down Expand Up @@ -84,8 +84,8 @@ def _step(self, a):
return ob, reward, self.ale.game_over(), {"ale.lives": self.ale.lives()}

def _get_image(self):
self.ale.getScreenRGB2(self._buffer) # New in atari-py 2017-3-28
return self._buffer
self.ale.getScreenRGB(self._buffer) # says rgb but actually bgr on little-endian systems like x86
return self._buffer[:, :, [2, 1, 0]]

def _get_ram(self):
return to_ram(self.ale)
Expand Down

0 comments on commit f719298

Please sign in to comment.