From 96e7b31d71023217ffe9e7febff2ef2c5db88513 Mon Sep 17 00:00:00 2001 From: Oscar Ramirez Date: Mon, 17 Jun 2019 10:59:15 -0700 Subject: [PATCH] Update gym version. PiperOrigin-RevId: 253615467 Change-Id: I142eaedd5c73627900fc2bc5918716ba15274a4f --- setup.py | 4 ++-- tf_agents/environments/atari_wrappers.py | 4 ++-- tf_agents/environments/suite_atari.py | 2 +- tf_agents/environments/suite_gym.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 5fe9334ce..9482433bf 100644 --- a/setup.py +++ b/setup.py @@ -136,9 +136,9 @@ def main(_): TEST_REQUIRED_PACKAGES = [ 'atari_py == 0.1.7', - 'gym == 0.10.11', + 'gym == 0.12.5', 'opencv-python >= 3.4.1.15', - 'pybullet == 2.4.2', + 'pybullet', 'scipy == 1.1.0', ] diff --git a/tf_agents/environments/atari_wrappers.py b/tf_agents/environments/atari_wrappers.py index 7521c0347..d7c82a428 100644 --- a/tf_agents/environments/atari_wrappers.py +++ b/tf_agents/environments/atari_wrappers.py @@ -47,13 +47,13 @@ def __getattr__(self, name): def _generate_observation(self): return np.concatenate(self._frames, axis=2) - def _reset(self): + def reset(self): observation = self._env.reset() for _ in range(FrameStack4.STACK_SIZE): self._frames.append(observation) return self._generate_observation() - def _step(self, action): + def step(self, action): observation, reward, done, info = self._env.step(action) self._frames.append(observation) return self._generate_observation(), reward, done, info diff --git a/tf_agents/environments/suite_atari.py b/tf_agents/environments/suite_atari.py index 22cf8d35d..d2337c22e 100644 --- a/tf_agents/environments/suite_atari.py +++ b/tf_agents/environments/suite_atari.py @@ -73,7 +73,7 @@ def load(environment_name, gym_spec = gym.spec(environment_name) gym_env = gym_spec.make() - if max_episode_steps is None and gym_spec.timestep_limit is not None: + if max_episode_steps is None and gym_spec.max_episode_steps is not None: max_episode_steps = gym_spec.max_episode_steps return suite_gym.wrap_env( diff --git a/tf_agents/environments/suite_gym.py b/tf_agents/environments/suite_gym.py index c1d1ac347..99fa9e075 100644 --- a/tf_agents/environments/suite_gym.py +++ b/tf_agents/environments/suite_gym.py @@ -46,7 +46,7 @@ def load(environment_name, discount: Discount to use for the environment. max_episode_steps: If None the max_episode_steps will be set to the default step limit defined in the environment's spec. No limit is applied if set - to 0 or if there is no timestep_limit set in the environment's spec. + to 0 or if there is no max_episode_steps set in the environment's spec. gym_env_wrappers: Iterable with references to wrapper classes to use directly on the gym environment. env_wrappers: Iterable with references to wrapper classes to use on the @@ -63,7 +63,7 @@ def load(environment_name, gym_spec = gym.spec(environment_name) gym_env = gym_spec.make() - if max_episode_steps is None and gym_spec.timestep_limit is not None: + if max_episode_steps is None and gym_spec.max_episode_steps is not None: max_episode_steps = gym_spec.max_episode_steps return wrap_env( @@ -93,7 +93,7 @@ def wrap_env(gym_env, gym_env: An instance of OpenAI gym environment. discount: Discount to use for the environment. max_episode_steps: Used to create a TimeLimitWrapper. No limit is applied - if set to 0. Usually set to `gym_spec.timestep_limit` as done in `load. + if set to 0. Usually set to `gym_spec.max_episode_steps` as done in `load. gym_env_wrappers: Iterable with references to wrapper classes to use directly on the gym environment. time_limit_wrapper: Wrapper that accepts (env, max_episode_steps) params to