Skip to content

Commit

Permalink
Update atari_preprocessing.py (#3105)
Browse files Browse the repository at this point in the history
  • Loading branch information
vermouth1992 committed Oct 4, 2022
1 parent 2ac7b1c commit 21e6e27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gym/wrappers/atari_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def __init__(
np.empty(env.observation_space.shape, dtype=np.uint8),
]

self.ale = env.unwrapped.ale
self.lives = 0
self.game_over = False

Expand All @@ -111,6 +110,11 @@ def __init__(
self.observation_space = Box(
low=_low, high=_high, shape=_shape, dtype=_obs_dtype
)

@property
def ale(self):
"""Make ale as a class property to avoid serialization error"""
return self.env.unwrapped.ale

def step(self, action):
"""Applies the preprocessing for an :meth:`env.step`."""
Expand Down

0 comments on commit 21e6e27

Please sign in to comment.