Skip to content

Commit

Permalink
Require pillow and use KellyCoinflip instead of FrozenLake for gym te…
Browse files Browse the repository at this point in the history
…st. These changes need to go together because the build is broke due to both reasons in the past 12-24 hours.

- Pillow was likely (I have not looked into that yet) being installed by another required package and is no longer a dependency of that package and thus the failure began.

- OpenAI Gym is not longer loading FrozenLake-v0 and FrozenLake-v1 is new and might not be available to all users. Moving the kwargs test to use KellyCoinflip resolves the problem. Here is what happened with FrozenLake-v0: openai/gym#2205 and openai/gym#2315

PiperOrigin-RevId: 391328529
Change-Id: I09e6e962a32330b24b1fc44ebe222fb1d842d5c3
  • Loading branch information
tfboyd authored and Copybara-Service committed Aug 17, 2021
1 parent c59573d commit 6784d95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -174,6 +174,7 @@ def get_required_packages():
'gin-config >= 0.4.0',
'gym >= 0.17.0',
'numpy >= 1.13.3',
'pillow',
'six >= 1.10.0',
'protobuf >= 3.11.3',
'wrapt >= 1.11.1',
Expand Down
9 changes: 5 additions & 4 deletions tf_agents/environments/suite_gym_test.py
Expand Up @@ -69,11 +69,12 @@ def testGinConfig(self):
self.assertIsInstance(env, wrappers.TimeLimit)

def test_gym_kwargs_argument(self):
env = suite_gym.load('FrozenLake-v0', gym_kwargs={'map_name': '4x4'})
self.assertTupleEqual(env.unwrapped.desc.shape, (4, 4))
env = suite_gym.load('KellyCoinflip-v0', gym_kwargs={'initial_wealth': 21})
self.assertEqual(env.unwrapped.initial_wealth, 21)

env = suite_gym.load('FrozenLake-v0', gym_kwargs={'map_name': '8x8'})
self.assertTupleEqual(env.unwrapped.desc.shape, (8, 8))
env = suite_gym.load('KellyCoinflip-v0',
gym_kwargs={'initial_wealth': 50})
self.assertEqual(env.unwrapped.initial_wealth, 50)

def test_load_gym_render_kwargs(self):
env = suite_gym.load('CartPole-v1',
Expand Down

0 comments on commit 6784d95

Please sign in to comment.