bug fix for gym==0.19.0

This commit is contained in:
NM512
2023-05-18 21:30:08 +09:00
parent d3156ecb06
commit b8ef214efa
3 changed files with 5 additions and 2 deletions

View File

@@ -68,7 +68,6 @@ class Atari:
@property
def observation_space(self):
img_shape = self._size + ((1,) if self._gray else (3,))
print(self._env.observation_space)
return gym.spaces.Dict(
{
"image": gym.spaces.Box(0, 255, img_shape, np.uint8),

View File

@@ -180,7 +180,7 @@ class RewardObs:
def observation_space(self):
spaces = self._env.observation_space.spaces
assert "reward" not in spaces
spaces["reward"] = gym.spaces.Box(-np.inf, np.inf, dtype=np.float32)
spaces["reward"] = gym.spaces.Box(-np.inf, np.inf, shape=(1,), dtype=np.float32)
return gym.spaces.Dict(spaces)
def step(self, action):