fix dtype for wrapper observation spaces

This commit is contained in:
Karl Cobbe
2018-06-12 14:48:39 -07:00
parent a1d3c18ec0
commit 622915c473

View File

@@ -174,7 +174,7 @@ class FrameStack(gym.Wrapper):
class ScaledFloatFrame(gym.ObservationWrapper):
def __init__(self, env):
gym.ObservationWrapper.__init__(self, env)
self.observation_space.dtype = np.float32
self.observation_space = gym.spaces.Box(low=0, high=1, shape=env.observation_space.shape, dtype=np.float32)
def observation(self, observation):
# careful! This undoes the memory optimization, use