Skip to content

Commit 40a9e35

Browse files
committed
Fix newer Gym support
1 parent 60e0d07 commit 40a9e35

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

minerl/herobraine/hero/handlers/agent/observations/lifestats.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class _IsAliveObservation(LifeStatsObservation):
5959
def __init__(self):
6060
keys = ['is_alive']
6161
super().__init__(hero_keys=keys, univ_keys=keys,
62-
space=spaces.Box(low=False, high=True, shape=(), dtype=bool),
63-
default_if_missing=True)
62+
space=spaces.Box(low=0, high=1, shape=(), dtype=bool),
63+
default_if_missing=1)
6464

6565

6666
class _LifeObservation(LifeStatsObservation):

minerl/herobraine/hero/spaces.py

-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ class Discrete(gym.spaces.Discrete, MineRLSpace):
203203
def __init__(self, *args, **kwargs):
204204
super(Discrete, self).__init__(*args, **kwargs)
205205
self.eye = np.eye(self.n, dtype=np.float32)
206-
self.shape = ()
207206

208207
def no_op(self, batch_shape=()):
209208
if len(batch_shape) == 0:

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gym @ git+https://github.com/minerllabs/gym@minerl-fix
1+
gym>=0.19.0,<=0.23.1
22
opencv-python>=4.1.0.25
33
setuptools>=49.2.0
44
tqdm>=4.32.2

0 commit comments

Comments
 (0)