From 373cf88a6d95eb4fd1c667022cb632e6db17452a Mon Sep 17 00:00:00 2001 From: Vincent Roseberry Date: Mon, 1 Mar 2021 20:26:41 +0000 Subject: [PATCH] Remove tensorforce package. Last usage in our platform was in October 2020. In the past year, we have seen 14 notebooks using it only. User wanting to use this package should use `!pip install tensorforce` into their own kernel. TensorForce 0.6.2 has dependencies on tensorflow==2.3.1 and numpy==1.18.5 which is incompatible with our environment. We don't want to constrain new release of TensorFlow for a package that is barely being used. Hence, the reason for dropping it from our base image. http://b/181584341 --- Dockerfile | 2 -- tests/test_tensorforce.py | 30 ------------------------------ 2 files changed, 32 deletions(-) delete mode 100644 tests/test_tensorforce.py diff --git a/Dockerfile b/Dockerfile index f7080c5b..2d31d24b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -375,8 +375,6 @@ RUN pip install flashtext && \ pip install shap && \ pip install ray && \ pip install gym && \ - # b/167268016 tensorforce 0.6.6 has an explicit dependency on tensorflow 2.3.1 which is causing a downgrade. - pip install tensorforce==0.5.5 && \ pip install pyarabic && \ pip install pandasql && \ pip install tensorflow_hub && \ diff --git a/tests/test_tensorforce.py b/tests/test_tensorforce.py deleted file mode 100644 index a468b27c..00000000 --- a/tests/test_tensorforce.py +++ /dev/null @@ -1,30 +0,0 @@ -import unittest - -from tensorforce import Agent, Environment - -class TestTensorforce(unittest.TestCase): - # based on https://github.com/tensorforce/tensorforce/tree/master#quickstart-example-code. - def test_quickstart(self): - environment = Environment.create( - environment='gym', level='CartPole', max_episode_timesteps=500 - ) - - agent = Agent.create( - agent='tensorforce', - environment=environment, # alternatively: states, actions, (max_episode_timesteps) - memory=1000, - update=dict(unit='timesteps', batch_size=32), - optimizer=dict(type='adam', learning_rate=3e-4), - policy=dict(network='auto'), - objective='policy_gradient', - reward_estimation=dict(horizon=1) - ) - - # Train for a single episode. - states = environment.reset() - actions = agent.act(states=states) - states, terminal, reward = environment.execute(actions=actions) - - self.assertEqual(4, len(states)) - self.assertFalse(terminal) - self.assertEqual(1, reward)