From 1018fb17e8edb76579210fdb184d785da85a9c92 Mon Sep 17 00:00:00 2001 From: MaxVanDijck Date: Fri, 28 Jun 2024 14:33:31 +1200 Subject: [PATCH 1/3] rename all np.product to np.prod Signed-off-by: MaxVanDijck --- python/ray/data/datasource/range_datasource.py | 4 ++-- rllib/algorithms/sac/rnnsac_torch_policy.py | 2 +- rllib/algorithms/sac/sac_tf_model.py | 4 ++-- rllib/algorithms/sac/sac_torch_model.py | 4 ++-- rllib/examples/_old_api_stack/models/batch_norm_model.py | 2 +- .../examples/_old_api_stack/models/shared_weights_model.py | 2 +- rllib/models/catalog.py | 4 ++-- rllib/models/preprocessors.py | 6 +++--- rllib/models/tf/attention_net.py | 2 +- rllib/models/tf/complex_input_net.py | 2 +- rllib/models/tf/fcnet.py | 4 ++-- rllib/models/tf/recurrent_net.py | 4 ++-- rllib/models/torch/attention_net.py | 2 +- rllib/models/torch/complex_input_net.py | 2 +- rllib/models/torch/fcnet.py | 6 +++--- rllib/models/torch/recurrent_net.py | 4 ++-- rllib_contrib/crr/src/rllib_crr/crr/crr_torch_model.py | 2 +- rllib_contrib/crr/src/rllib_crr/crr/crr_torch_policy.py | 2 +- rllib_contrib/ddpg/src/rllib_ddpg/ddpg/ddpg_torch_model.py | 2 +- rllib_contrib/ddpg/src/rllib_ddpg/ddpg/utils.py | 2 +- rllib_contrib/dt/src/rllib_dt/dt/dt_torch_model.py | 2 +- rllib_contrib/dt/src/rllib_dt/dt/dt_torch_policy.py | 2 +- 22 files changed, 33 insertions(+), 33 deletions(-) diff --git a/python/ray/data/datasource/range_datasource.py b/python/ray/data/datasource/range_datasource.py index e85d725cf8c4..d944c1d3d025 100644 --- a/python/ray/data/datasource/range_datasource.py +++ b/python/ray/data/datasource/range_datasource.py @@ -30,7 +30,7 @@ def __init__( def estimate_inmemory_data_size(self) -> Optional[int]: if self._block_format == "tensor": - element_size = int(np.product(self._tensor_shape)) + element_size = int(np.prod(self._tensor_shape)) else: element_size = 1 return 8 * self._n * element_size @@ -88,7 +88,7 @@ def make_blocks( count -= num_rows if block_format == "tensor": - element_size = int(np.product(tensor_shape)) + element_size = int(np.prod(tensor_shape)) else: element_size = 1 diff --git a/rllib/algorithms/sac/rnnsac_torch_policy.py b/rllib/algorithms/sac/rnnsac_torch_policy.py index 085c287594cb..29adffd77bb4 100644 --- a/rllib/algorithms/sac/rnnsac_torch_policy.py +++ b/rllib/algorithms/sac/rnnsac_torch_policy.py @@ -43,7 +43,7 @@ def build_rnnsac_model( `policy.target_model`. """ # With separate state-preprocessor (before obs+action concat). - num_outputs = int(np.product(obs_space.shape)) + num_outputs = int(np.prod(obs_space.shape)) # Force-ignore any additionally provided hidden layer sizes. # Everything should be configured using SAC's `q_model_config` and diff --git a/rllib/algorithms/sac/sac_tf_model.py b/rllib/algorithms/sac/sac_tf_model.py index 7faf20acb2b7..7302a25fcccf 100644 --- a/rllib/algorithms/sac/sac_tf_model.py +++ b/rllib/algorithms/sac/sac_tf_model.py @@ -77,13 +77,13 @@ def __init__( self.discrete = True action_outs = q_outs = self.action_dim elif isinstance(action_space, Box): - self.action_dim = np.product(action_space.shape) + self.action_dim = np.prod(action_space.shape) self.discrete = False action_outs = 2 * self.action_dim q_outs = 1 else: assert isinstance(action_space, Simplex) - self.action_dim = np.product(action_space.shape) + self.action_dim = np.prod(action_space.shape) self.discrete = False action_outs = self.action_dim q_outs = 1 diff --git a/rllib/algorithms/sac/sac_torch_model.py b/rllib/algorithms/sac/sac_torch_model.py index 6e98a624b28f..00219fd95b8a 100644 --- a/rllib/algorithms/sac/sac_torch_model.py +++ b/rllib/algorithms/sac/sac_torch_model.py @@ -79,13 +79,13 @@ def __init__( self.discrete = True action_outs = q_outs = self.action_dim elif isinstance(action_space, Box): - self.action_dim = np.product(action_space.shape) + self.action_dim = np.prod(action_space.shape) self.discrete = False action_outs = 2 * self.action_dim q_outs = 1 else: assert isinstance(action_space, Simplex) - self.action_dim = np.product(action_space.shape) + self.action_dim = np.prod(action_space.shape) self.discrete = False action_outs = self.action_dim q_outs = 1 diff --git a/rllib/examples/_old_api_stack/models/batch_norm_model.py b/rllib/examples/_old_api_stack/models/batch_norm_model.py index 7a5ac956d24e..0153bf166dec 100644 --- a/rllib/examples/_old_api_stack/models/batch_norm_model.py +++ b/rllib/examples/_old_api_stack/models/batch_norm_model.py @@ -184,7 +184,7 @@ def __init__( ) nn.Module.__init__(self) layers = [] - prev_layer_size = int(np.product(obs_space.shape)) + prev_layer_size = int(np.prod(obs_space.shape)) self._logits = None # Create layers 0 to second-last. diff --git a/rllib/examples/_old_api_stack/models/shared_weights_model.py b/rllib/examples/_old_api_stack/models/shared_weights_model.py index 28ad0896b18f..478859af9da3 100644 --- a/rllib/examples/_old_api_stack/models/shared_weights_model.py +++ b/rllib/examples/_old_api_stack/models/shared_weights_model.py @@ -171,7 +171,7 @@ def __init__( # Non-shared initial layer. self.first_layer = SlimFC( - int(np.product(observation_space.shape)), + int(np.prod(observation_space.shape)), 64, activation_fn=nn.ReLU, initializer=torch.nn.init.xavier_uniform_, diff --git a/rllib/models/catalog.py b/rllib/models/catalog.py index 4800ae633178..64a4bf6af39a 100644 --- a/rllib/models/catalog.py +++ b/rllib/models/catalog.py @@ -385,7 +385,7 @@ def get_action_dist( dist_cls = ( TorchMultiCategorical if framework == "torch" else MultiCategorical ) - num_cats = int(np.product(action_space.shape)) + num_cats = int(np.prod(action_space.shape)) return ( partial( dist_cls, @@ -495,7 +495,7 @@ def get_action_shape( size += 1 else: all_discrete = False - size += np.product(flat_action_space[i].shape) + size += np.prod(flat_action_space[i].shape) size = int(size) return dl_lib.int32 if all_discrete else dl_lib.float32, (None, size) else: diff --git a/rllib/models/preprocessors.py b/rllib/models/preprocessors.py index f6578b58ec94..ad15d0c15512 100644 --- a/rllib/models/preprocessors.py +++ b/rllib/models/preprocessors.py @@ -38,7 +38,7 @@ def __init__(self, obs_space: gym.Space, options: dict = None): else: self._options = options self.shape = self._init_shape(obs_space, self._options) - self._size = int(np.product(self.shape)) + self._size = int(np.prod(self.shape)) self._i = 0 self._obs_for_type_matching = self._obs_space.sample() @@ -276,7 +276,7 @@ def _init_shape(self, obs_space: gym.Space, options: dict) -> List[int]: size += preprocessor.size else: preprocessor = None - size += int(np.product(space.shape)) + size += int(np.prod(space.shape)) self.preprocessors.append(preprocessor) return (size,) @@ -315,7 +315,7 @@ def _init_shape(self, obs_space: gym.Space, options: dict) -> List[int]: size += preprocessor.size else: preprocessor = None - size += int(np.product(space.shape)) + size += int(np.prod(space.shape)) self.preprocessors.append(preprocessor) return (size,) diff --git a/rllib/models/tf/attention_net.py b/rllib/models/tf/attention_net.py index 15e096887555..886580fce177 100644 --- a/rllib/models/tf/attention_net.py +++ b/rllib/models/tf/attention_net.py @@ -409,7 +409,7 @@ def __init__( elif isinstance(space, MultiDiscrete): self.action_dim += np.sum(space.nvec) elif space.shape is not None: - self.action_dim += int(np.product(space.shape)) + self.action_dim += int(np.prod(space.shape)) else: self.action_dim += int(len(space)) diff --git a/rllib/models/tf/complex_input_net.py b/rllib/models/tf/complex_input_net.py index 0ed5e7c91aa8..d8c41be4067a 100644 --- a/rllib/models/tf/complex_input_net.py +++ b/rllib/models/tf/complex_input_net.py @@ -98,7 +98,7 @@ def __init__(self, obs_space, action_space, num_outputs, model_config, name): concat_size += int(self.one_hot[i].num_outputs) # Everything else (1D Box). else: - size = int(np.product(component.shape)) + size = int(np.prod(component.shape)) config = { "fcnet_hiddens": model_config["fcnet_hiddens"], "fcnet_activation": model_config.get("fcnet_activation"), diff --git a/rllib/models/tf/fcnet.py b/rllib/models/tf/fcnet.py index bb59110124cc..1f2797efeb25 100644 --- a/rllib/models/tf/fcnet.py +++ b/rllib/models/tf/fcnet.py @@ -53,7 +53,7 @@ def __init__( # We are using obs_flat, so take the flattened shape as input. inputs = tf.keras.layers.Input( - shape=(int(np.product(obs_space.shape)),), name="observations" + shape=(int(np.prod(obs_space.shape)),), name="observations" ) # Last hidden layer output (before logits outputs). last_layer = inputs @@ -99,7 +99,7 @@ def __init__( )(last_layer) # Adjust num_outputs to be the number of nodes in the last layer. else: - self.num_outputs = ([int(np.product(obs_space.shape))] + hiddens[-1:])[ + self.num_outputs = ([int(np.prod(obs_space.shape))] + hiddens[-1:])[ -1 ] diff --git a/rllib/models/tf/recurrent_net.py b/rllib/models/tf/recurrent_net.py index 31f1763850b4..2010d4a90118 100644 --- a/rllib/models/tf/recurrent_net.py +++ b/rllib/models/tf/recurrent_net.py @@ -149,7 +149,7 @@ def __init__( # is the input size for the LSTM layer. # If None, set it to the observation space. if self.num_outputs is None: - self.num_outputs = int(np.product(self.obs_space.shape)) + self.num_outputs = int(np.prod(self.obs_space.shape)) self.cell_size = model_config["lstm_cell_size"] self.use_prev_action = model_config["lstm_use_prev_action"] @@ -164,7 +164,7 @@ def __init__( elif isinstance(space, MultiDiscrete): self.action_dim += np.sum(space.nvec) elif space.shape is not None: - self.action_dim += int(np.product(space.shape)) + self.action_dim += int(np.prod(space.shape)) else: self.action_dim += int(len(space)) diff --git a/rllib/models/torch/attention_net.py b/rllib/models/torch/attention_net.py index 5efdcd9434d6..2382a4da1381 100644 --- a/rllib/models/torch/attention_net.py +++ b/rllib/models/torch/attention_net.py @@ -289,7 +289,7 @@ def __init__( elif isinstance(space, MultiDiscrete): self.action_dim += np.sum(space.nvec) elif space.shape is not None: - self.action_dim += int(np.product(space.shape)) + self.action_dim += int(np.prod(space.shape)) else: self.action_dim += int(len(space)) diff --git a/rllib/models/torch/complex_input_net.py b/rllib/models/torch/complex_input_net.py index 9923b306423a..c5c81dba790c 100644 --- a/rllib/models/torch/complex_input_net.py +++ b/rllib/models/torch/complex_input_net.py @@ -118,7 +118,7 @@ def __init__(self, obs_space, action_space, num_outputs, model_config, name): self.add_module("one_hot_{}".format(i), self.one_hot[i]) # Everything else (1D Box). else: - size = int(np.product(component.shape)) + size = int(np.prod(component.shape)) config = { "fcnet_hiddens": model_config["fcnet_hiddens"], "fcnet_activation": model_config.get("fcnet_activation"), diff --git a/rllib/models/torch/fcnet.py b/rllib/models/torch/fcnet.py index 0a78cbc51e11..40e1022861dc 100644 --- a/rllib/models/torch/fcnet.py +++ b/rllib/models/torch/fcnet.py @@ -49,7 +49,7 @@ def __init__( num_outputs = num_outputs // 2 layers = [] - prev_layer_size = int(np.product(obs_space.shape)) + prev_layer_size = int(np.prod(obs_space.shape)) self._logits = None # Create layers 0 to second-last. @@ -97,7 +97,7 @@ def __init__( activation_fn=None, ) else: - self.num_outputs = ([int(np.product(obs_space.shape))] + hiddens[-1:])[ + self.num_outputs = ([int(np.prod(obs_space.shape))] + hiddens[-1:])[ -1 ] @@ -110,7 +110,7 @@ def __init__( self._value_branch_separate = None if not self.vf_share_layers: # Build a parallel set of hidden layers for the value net. - prev_vf_layer_size = int(np.product(obs_space.shape)) + prev_vf_layer_size = int(np.prod(obs_space.shape)) vf_layers = [] for size in hiddens: vf_layers.append( diff --git a/rllib/models/torch/recurrent_net.py b/rllib/models/torch/recurrent_net.py index 01fd0a0757bd..01fbab223e29 100644 --- a/rllib/models/torch/recurrent_net.py +++ b/rllib/models/torch/recurrent_net.py @@ -145,7 +145,7 @@ def __init__( # is the input size for the LSTM layer. # If None, set it to the observation space. if self.num_outputs is None: - self.num_outputs = int(np.product(self.obs_space.shape)) + self.num_outputs = int(np.prod(self.obs_space.shape)) self.cell_size = model_config["lstm_cell_size"] self.time_major = model_config.get("_time_major", False) @@ -161,7 +161,7 @@ def __init__( elif isinstance(space, MultiDiscrete): self.action_dim += np.sum(space.nvec) elif space.shape is not None: - self.action_dim += int(np.product(space.shape)) + self.action_dim += int(np.prod(space.shape)) else: self.action_dim += int(len(space)) diff --git a/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_model.py b/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_model.py index f59e202e039b..d8f847ec9444 100644 --- a/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_model.py +++ b/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_model.py @@ -30,7 +30,7 @@ def __init__( # TODO: I don't know why this is true yet? (in = num_outputs) self.obs_ins = num_outputs - self.action_dim = np.product(self.action_space.shape) + self.action_dim = np.prod(self.action_space.shape) self.actor_model = self._build_actor_net("actor") twin_q = self.model_config["twin_q"] self.q_model = self._build_q_net("q") diff --git a/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_policy.py b/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_policy.py index 80dffc79073a..bbf3bb8af755 100644 --- a/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_policy.py +++ b/rllib_contrib/crr/src/rllib_crr/crr/crr_torch_policy.py @@ -96,7 +96,7 @@ def make_model(self) -> ModelV2: twin_q=self.config["twin_q"], ) ) - num_outputs = int(np.product(self.observation_space.shape)) + num_outputs = int(np.prod(self.observation_space.shape)) # TODO: why do we even have to go through this get_model_v2 function? self.model = ModelCatalog.get_model_v2( diff --git a/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/ddpg_torch_model.py b/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/ddpg_torch_model.py index 644e96cf90af..d3fe93ab4b3b 100644 --- a/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/ddpg_torch_model.py +++ b/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/ddpg_torch_model.py @@ -67,7 +67,7 @@ def __init__( self.bounded = np.logical_and( self.action_space.bounded_above, self.action_space.bounded_below ).any() - self.action_dim = np.product(self.action_space.shape) + self.action_dim = np.prod(self.action_space.shape) # Build the policy network. self.policy_model = nn.Sequential() diff --git a/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/utils.py b/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/utils.py index 0200ea99230e..a2cdd6633a49 100644 --- a/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/utils.py +++ b/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/utils.py @@ -19,7 +19,7 @@ def make_ddpg_models(policy: Policy) -> ModelV2: default_model = ( TorchNoopModel if policy.config["framework"] == "torch" else NoopModel ) - num_outputs = int(np.product(policy.observation_space.shape)) + num_outputs = int(np.prod(policy.observation_space.shape)) model = ModelCatalog.get_model_v2( obs_space=policy.observation_space, diff --git a/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_model.py b/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_model.py index 678bc201ceed..55b1c58ee8e1 100644 --- a/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_model.py +++ b/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_model.py @@ -35,7 +35,7 @@ def __init__( if isinstance(action_space, Discrete): self.action_dim = action_space.n elif isinstance(action_space, Box): - self.action_dim = np.product(action_space.shape) + self.action_dim = np.prod(action_space.shape) else: raise NotImplementedError diff --git a/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_policy.py b/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_policy.py index a0c971fd249f..e3f3323ff89f 100644 --- a/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_policy.py +++ b/rllib_contrib/dt/src/rllib_dt/dt/dt_torch_policy.py @@ -76,7 +76,7 @@ def make_model_and_action_dist( use_return_output=self.config.get("loss_coef_returns_to_go", 0) > 0, ) - num_outputs = int(np.product(self.observation_space.shape)) + num_outputs = int(np.prod(self.observation_space.shape)) model = ModelCatalog.get_model_v2( obs_space=self.observation_space, From c617aa364d48db56cbd3a419d549d79af0cc1a90 Mon Sep 17 00:00:00 2001 From: MaxVanDijck Date: Fri, 28 Jun 2024 17:04:16 +1200 Subject: [PATCH 2/3] lint Signed-off-by: MaxVanDijck --- rllib/models/tf/fcnet.py | 4 +--- rllib/models/torch/fcnet.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/rllib/models/tf/fcnet.py b/rllib/models/tf/fcnet.py index 1f2797efeb25..56a09de0361a 100644 --- a/rllib/models/tf/fcnet.py +++ b/rllib/models/tf/fcnet.py @@ -99,9 +99,7 @@ def __init__( )(last_layer) # Adjust num_outputs to be the number of nodes in the last layer. else: - self.num_outputs = ([int(np.prod(obs_space.shape))] + hiddens[-1:])[ - -1 - ] + self.num_outputs = ([int(np.prod(obs_space.shape))] + hiddens[-1:])[-1] # Concat the log std vars to the end of the state-dependent means. if free_log_std and logits_out is not None: diff --git a/rllib/models/torch/fcnet.py b/rllib/models/torch/fcnet.py index 40e1022861dc..2ba907a54ed0 100644 --- a/rllib/models/torch/fcnet.py +++ b/rllib/models/torch/fcnet.py @@ -97,9 +97,7 @@ def __init__( activation_fn=None, ) else: - self.num_outputs = ([int(np.prod(obs_space.shape))] + hiddens[-1:])[ - -1 - ] + self.num_outputs = ([int(np.prod(obs_space.shape))] + hiddens[-1:])[-1] # Layer to add the log std vars to the state-dependent means. if self.free_log_std and self._logits: From bd4c72165729aa5dffdee4ca7108a03cda77db61 Mon Sep 17 00:00:00 2001 From: MaxVanDijck Date: Sun, 21 Jul 2024 20:46:28 +1200 Subject: [PATCH 3/3] numpy<2 in failing rllib_contrib tests Signed-off-by: MaxVanDijck --- rllib_contrib/a2c/pyproject.toml | 2 +- rllib_contrib/a2c/requirements.txt | 1 + rllib_contrib/a3c/pyproject.toml | 2 +- rllib_contrib/a3c/requirements.txt | 1 + rllib_contrib/alpha_star/pyproject.toml | 2 +- rllib_contrib/alpha_star/requirements.txt | 1 + rllib_contrib/alpha_zero/pyproject.toml | 2 +- rllib_contrib/alpha_zero/requirements.txt | 1 + rllib_contrib/apex_ddpg/pyproject.toml | 2 +- rllib_contrib/apex_ddpg/requirements.txt | 1 + rllib_contrib/apex_dqn/pyproject.toml | 2 +- rllib_contrib/apex_dqn/requirements.txt | 1 + rllib_contrib/ars/pyproject.toml | 2 +- rllib_contrib/ars/requirements.txt | 1 + rllib_contrib/crr/pyproject.toml | 2 +- rllib_contrib/crr/requirements.txt | 1 + rllib_contrib/ddppo/pyproject.toml | 2 +- rllib_contrib/ddppo/requirements.txt | 1 + rllib_contrib/dt/pyproject.toml | 2 +- rllib_contrib/dt/requirements.txt | 1 + rllib_contrib/es/pyproject.toml | 2 +- rllib_contrib/es/requirements.txt | 1 + rllib_contrib/leela_chess_zero/pyproject.toml | 2 +- rllib_contrib/leela_chess_zero/requirements.txt | 1 + rllib_contrib/maddpg/pyproject.toml | 2 +- rllib_contrib/maddpg/requirements.txt | 1 + rllib_contrib/maml/pyproject.toml | 2 +- rllib_contrib/maml/requirements.txt | 1 + rllib_contrib/mbmpo/pyproject.toml | 2 +- rllib_contrib/mbmpo/requirements.txt | 1 + rllib_contrib/pg/pyproject.toml | 2 +- rllib_contrib/pg/requirements.txt | 1 + rllib_contrib/qmix/pyproject.toml | 2 +- rllib_contrib/qmix/requirements.txt | 1 + rllib_contrib/r2d2/pyproject.toml | 2 +- rllib_contrib/r2d2/requirements.txt | 1 + rllib_contrib/simple_q/pyproject.toml | 2 +- rllib_contrib/simple_q/requirements.txt | 1 + rllib_contrib/slate_q/pyproject.toml | 2 +- rllib_contrib/slate_q/requirements.txt | 1 + rllib_contrib/td3/pyproject.toml | 2 +- rllib_contrib/td3/requirements.txt | 1 + 42 files changed, 42 insertions(+), 21 deletions(-) diff --git a/rllib_contrib/a2c/pyproject.toml b/rllib_contrib/a2c/pyproject.toml index 785fdffcf6a0..91944981a2f2 100644 --- a/rllib_contrib/a2c/pyproject.toml +++ b/rllib_contrib/a2c/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gym[accept-rom-license]", "gymnasium[accept-rom-license, atari]==0.26.3", "ray[rllib]==2.5.0"] [project.optional-dependencies] - development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] + development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/a2c/requirements.txt b/rllib_contrib/a2c/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/a2c/requirements.txt +++ b/rllib_contrib/a2c/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/a3c/pyproject.toml b/rllib_contrib/a3c/pyproject.toml index f7a0d10433f2..60aefa393869 100644 --- a/rllib_contrib/a3c/pyproject.toml +++ b/rllib_contrib/a3c/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gym[accept-rom-license]", "gymnasium[mujoco]==0.26.3", "ray[rllib]==2.3.1"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/a3c/requirements.txt b/rllib_contrib/a3c/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/a3c/requirements.txt +++ b/rllib_contrib/a3c/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/alpha_star/pyproject.toml b/rllib_contrib/alpha_star/pyproject.toml index 1abbb3484ff0..c81781a9af0b 100644 --- a/rllib_contrib/alpha_star/pyproject.toml +++ b/rllib_contrib/alpha_star/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gym", "gymnasium==0.26.3", "ray[rllib]==2.5.0", "open-spiel==1.3"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/alpha_star/requirements.txt b/rllib_contrib/alpha_star/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/alpha_star/requirements.txt +++ b/rllib_contrib/alpha_star/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/alpha_zero/pyproject.toml b/rllib_contrib/alpha_zero/pyproject.toml index 4f3a1e8260f1..c9623f61b3ff 100644 --- a/rllib_contrib/alpha_zero/pyproject.toml +++ b/rllib_contrib/alpha_zero/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium==0.26.3", "ray[rllib]==2.5.1"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/alpha_zero/requirements.txt b/rllib_contrib/alpha_zero/requirements.txt index e237d2a81749..b07006a1b4ec 100644 --- a/rllib_contrib/alpha_zero/requirements.txt +++ b/rllib_contrib/alpha_zero/requirements.txt @@ -1 +1,2 @@ torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/apex_ddpg/pyproject.toml b/rllib_contrib/apex_ddpg/pyproject.toml index 94cc180e96d4..35f91d20e585 100644 --- a/rllib_contrib/apex_ddpg/pyproject.toml +++ b/rllib_contrib/apex_ddpg/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium[atari]", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/apex_ddpg/requirements.txt b/rllib_contrib/apex_ddpg/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/apex_ddpg/requirements.txt +++ b/rllib_contrib/apex_ddpg/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/apex_dqn/pyproject.toml b/rllib_contrib/apex_dqn/pyproject.toml index f6a2a6c13c66..fdf271baf997 100644 --- a/rllib_contrib/apex_dqn/pyproject.toml +++ b/rllib_contrib/apex_dqn/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium[atari]", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/apex_dqn/requirements.txt b/rllib_contrib/apex_dqn/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/apex_dqn/requirements.txt +++ b/rllib_contrib/apex_dqn/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/ars/pyproject.toml b/rllib_contrib/ars/pyproject.toml index 06edc13fc5f1..c5a44d58d468 100644 --- a/rllib_contrib/ars/pyproject.toml +++ b/rllib_contrib/ars/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/ars/requirements.txt b/rllib_contrib/ars/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/ars/requirements.txt +++ b/rllib_contrib/ars/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/crr/pyproject.toml b/rllib_contrib/crr/pyproject.toml index ac2f22f5f082..75efc151f3d7 100644 --- a/rllib_contrib/crr/pyproject.toml +++ b/rllib_contrib/crr/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/crr/requirements.txt b/rllib_contrib/crr/requirements.txt index e237d2a81749..b07006a1b4ec 100644 --- a/rllib_contrib/crr/requirements.txt +++ b/rllib_contrib/crr/requirements.txt @@ -1 +1,2 @@ torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/ddppo/pyproject.toml b/rllib_contrib/ddppo/pyproject.toml index 2b1c697a8643..b79c89da2adc 100644 --- a/rllib_contrib/ddppo/pyproject.toml +++ b/rllib_contrib/ddppo/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "numpy<2"] diff --git a/rllib_contrib/ddppo/requirements.txt b/rllib_contrib/ddppo/requirements.txt index e237d2a81749..b07006a1b4ec 100644 --- a/rllib_contrib/ddppo/requirements.txt +++ b/rllib_contrib/ddppo/requirements.txt @@ -1 +1,2 @@ torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/dt/pyproject.toml b/rllib_contrib/dt/pyproject.toml index c9d726520a62..be8ca6555564 100644 --- a/rllib_contrib/dt/pyproject.toml +++ b/rllib_contrib/dt/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "numpy<2"] diff --git a/rllib_contrib/dt/requirements.txt b/rllib_contrib/dt/requirements.txt index e237d2a81749..b07006a1b4ec 100644 --- a/rllib_contrib/dt/requirements.txt +++ b/rllib_contrib/dt/requirements.txt @@ -1 +1,2 @@ torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/es/pyproject.toml b/rllib_contrib/es/pyproject.toml index 778be86b7f79..57a3427d1851 100644 --- a/rllib_contrib/es/pyproject.toml +++ b/rllib_contrib/es/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/es/requirements.txt b/rllib_contrib/es/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/es/requirements.txt +++ b/rllib_contrib/es/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/leela_chess_zero/pyproject.toml b/rllib_contrib/leela_chess_zero/pyproject.toml index 52998274951f..07d0946ea75c 100644 --- a/rllib_contrib/leela_chess_zero/pyproject.toml +++ b/rllib_contrib/leela_chess_zero/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium==0.26.3", "pettingzoo==1.22.4", "chess==1.10.0", "ray[rllib]==2.5.0", "pygame"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/leela_chess_zero/requirements.txt b/rllib_contrib/leela_chess_zero/requirements.txt index e237d2a81749..b07006a1b4ec 100644 --- a/rllib_contrib/leela_chess_zero/requirements.txt +++ b/rllib_contrib/leela_chess_zero/requirements.txt @@ -1 +1,2 @@ torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/maddpg/pyproject.toml b/rllib_contrib/maddpg/pyproject.toml index f494a54e3e28..b67761f6aeed 100644 --- a/rllib_contrib/maddpg/pyproject.toml +++ b/rllib_contrib/maddpg/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium==0.26.3", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "numpy<2"] diff --git a/rllib_contrib/maddpg/requirements.txt b/rllib_contrib/maddpg/requirements.txt index f5b8e9c4347a..ea076922983b 100644 --- a/rllib_contrib/maddpg/requirements.txt +++ b/rllib_contrib/maddpg/requirements.txt @@ -1,2 +1,3 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 +numpy<2 diff --git a/rllib_contrib/maml/pyproject.toml b/rllib_contrib/maml/pyproject.toml index bf6df70018fe..4ab4de55883b 100644 --- a/rllib_contrib/maml/pyproject.toml +++ b/rllib_contrib/maml/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium[mujoco]==0.26.3", "higher", "ray[rllib]==2.3.1"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/maml/requirements.txt b/rllib_contrib/maml/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/maml/requirements.txt +++ b/rllib_contrib/maml/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/mbmpo/pyproject.toml b/rllib_contrib/mbmpo/pyproject.toml index 00a77adfcf36..13bd725c0912 100644 --- a/rllib_contrib/mbmpo/pyproject.toml +++ b/rllib_contrib/mbmpo/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gym[accept-rom-license]", "gymnasium[mujoco]==0.26.3", "higher", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/mbmpo/requirements.txt b/rllib_contrib/mbmpo/requirements.txt index e237d2a81749..b07006a1b4ec 100644 --- a/rllib_contrib/mbmpo/requirements.txt +++ b/rllib_contrib/mbmpo/requirements.txt @@ -1 +1,2 @@ torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/pg/pyproject.toml b/rllib_contrib/pg/pyproject.toml index 5dfbd2604b7d..535be2c8f425 100644 --- a/rllib_contrib/pg/pyproject.toml +++ b/rllib_contrib/pg/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gym[accept-rom-license]", "gymnasium[accept-rom-license, atari]==0.26.3", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/pg/requirements.txt b/rllib_contrib/pg/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/pg/requirements.txt +++ b/rllib_contrib/pg/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/qmix/pyproject.toml b/rllib_contrib/qmix/pyproject.toml index 402af28b82b4..00ef4d68f57f 100644 --- a/rllib_contrib/qmix/pyproject.toml +++ b/rllib_contrib/qmix/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium==0.26.3", "ray[rllib]==2.5.1"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "torch==1.12.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "numpy<2"] diff --git a/rllib_contrib/qmix/requirements.txt b/rllib_contrib/qmix/requirements.txt index e237d2a81749..b07006a1b4ec 100644 --- a/rllib_contrib/qmix/requirements.txt +++ b/rllib_contrib/qmix/requirements.txt @@ -1 +1,2 @@ torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/r2d2/pyproject.toml b/rllib_contrib/r2d2/pyproject.toml index f66d4ed394a9..ccd4119da7d8 100644 --- a/rllib_contrib/r2d2/pyproject.toml +++ b/rllib_contrib/r2d2/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium==0.26.3", "ray[rllib]==2.5.0"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/r2d2/requirements.txt b/rllib_contrib/r2d2/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/r2d2/requirements.txt +++ b/rllib_contrib/r2d2/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/simple_q/pyproject.toml b/rllib_contrib/simple_q/pyproject.toml index ceb491e18181..99ec2fd422f4 100644 --- a/rllib_contrib/simple_q/pyproject.toml +++ b/rllib_contrib/simple_q/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium==0.26.3", "ray[rllib]==2.5.1"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/simple_q/requirements.txt b/rllib_contrib/simple_q/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/simple_q/requirements.txt +++ b/rllib_contrib/simple_q/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/slate_q/pyproject.toml b/rllib_contrib/slate_q/pyproject.toml index 2c0a33e25634..d0f18c25b094 100644 --- a/rllib_contrib/slate_q/pyproject.toml +++ b/rllib_contrib/slate_q/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gym==0.26.2", "recsim==0.2.4", "gymnasium[mujoco]==0.26.3", "ray[rllib]==2.5.1"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "tensorflow-probability==0.19.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/slate_q/requirements.txt b/rllib_contrib/slate_q/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/slate_q/requirements.txt +++ b/rllib_contrib/slate_q/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2 diff --git a/rllib_contrib/td3/pyproject.toml b/rllib_contrib/td3/pyproject.toml index dd071c773e83..71fee404936a 100644 --- a/rllib_contrib/td3/pyproject.toml +++ b/rllib_contrib/td3/pyproject.toml @@ -15,4 +15,4 @@ requires-python = ">=3.7, <3.11" dependencies = ["gymnasium==0.26.3", "ray[rllib]==2.5.1"] [project.optional-dependencies] -development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0"] +development = ["pytest>=7.2.2", "pre-commit==2.21.0", "tensorflow==2.11.0", "torch==1.12.0", "numpy<2"] diff --git a/rllib_contrib/td3/requirements.txt b/rllib_contrib/td3/requirements.txt index 9c255b8ebb69..f16db019bb51 100644 --- a/rllib_contrib/td3/requirements.txt +++ b/rllib_contrib/td3/requirements.txt @@ -1,3 +1,4 @@ tensorflow==2.11.1 tensorflow-probability==0.19.0 torch==1.12.0 +numpy<2