Browse Source

Use correct shape for one hot encoding (#93)

Anders Thuesen 5 years ago
parent
commit
050ce008c8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      gym_minigrid/wrappers.py

+ 1 - 1
gym_minigrid/wrappers.py

@@ -135,7 +135,7 @@ class OneHotPartialObsWrapper(gym.core.ObservationWrapper):
 
     def observation(self, obs):
         img = obs['image']
-        out = np.zeros(self.observation_space.shape, dtype='uint8')
+        out = np.zeros(self.observation_space.spaces['image'].shape, dtype='uint8')
 
         for i in range(img.shape[0]):
             for j in range(img.shape[1]):