From 40a9e35c086c4dc7959ad473ec765cd4828c4631 Mon Sep 17 00:00:00 2001 From: Anssi Kanervisto Date: Wed, 23 Aug 2023 22:19:34 +0100 Subject: [PATCH] Fix newer Gym support --- .../herobraine/hero/handlers/agent/observations/lifestats.py | 4 ++-- minerl/herobraine/hero/spaces.py | 1 - requirements.txt | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/minerl/herobraine/hero/handlers/agent/observations/lifestats.py b/minerl/herobraine/hero/handlers/agent/observations/lifestats.py index 9cd400fb9..ce6a773c5 100644 --- a/minerl/herobraine/hero/handlers/agent/observations/lifestats.py +++ b/minerl/herobraine/hero/handlers/agent/observations/lifestats.py @@ -59,8 +59,8 @@ class _IsAliveObservation(LifeStatsObservation): def __init__(self): keys = ['is_alive'] super().__init__(hero_keys=keys, univ_keys=keys, - space=spaces.Box(low=False, high=True, shape=(), dtype=bool), - default_if_missing=True) + space=spaces.Box(low=0, high=1, shape=(), dtype=bool), + default_if_missing=1) class _LifeObservation(LifeStatsObservation): diff --git a/minerl/herobraine/hero/spaces.py b/minerl/herobraine/hero/spaces.py index d43184073..7448da375 100644 --- a/minerl/herobraine/hero/spaces.py +++ b/minerl/herobraine/hero/spaces.py @@ -203,7 +203,6 @@ class Discrete(gym.spaces.Discrete, MineRLSpace): def __init__(self, *args, **kwargs): super(Discrete, self).__init__(*args, **kwargs) self.eye = np.eye(self.n, dtype=np.float32) - self.shape = () def no_op(self, batch_shape=()): if len(batch_shape) == 0: diff --git a/requirements.txt b/requirements.txt index 04d88808d..3d1eba0e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -gym @ git+https://github.com/minerllabs/gym@minerl-fix +gym>=0.19.0,<=0.23.1 opencv-python>=4.1.0.25 setuptools>=49.2.0 tqdm>=4.32.2