From 622915c4734fc7008563f9a07b7caeaa057af8a6 Mon Sep 17 00:00:00 2001 From: Karl Cobbe Date: Tue, 12 Jun 2018 14:48:39 -0700 Subject: [PATCH] fix dtype for wrapper observation spaces --- baselines/common/atari_wrappers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baselines/common/atari_wrappers.py b/baselines/common/atari_wrappers.py index f192d7b..ee4abbb 100644 --- a/baselines/common/atari_wrappers.py +++ b/baselines/common/atari_wrappers.py @@ -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