diff --git a/python/requirements/ml/requirements_rllib.txt b/python/requirements/ml/requirements_rllib.txt index fa44e6823..a31fb641b 100644 --- a/python/requirements/ml/requirements_rllib.txt +++ b/python/requirements/ml/requirements_rllib.txt @@ -4,7 +4,7 @@ # --------------------- # Atari autorom[accept-rom-license] -gym>=0.21.0,<0.24.0; python_version >= '3.7' +gym>=0.21.0,<0.24.1; python_version >= '3.7' gym[atari]==0.19.0; python_version < '3.7' # Kaggle envs. kaggle_environments==1.7.11 diff --git a/release/long_running_distributed_tests/app_config.yaml b/release/long_running_distributed_tests/app_config.yaml index 7c0bd9221..d58c61ad7 100644 --- a/release/long_running_distributed_tests/app_config.yaml +++ b/release/long_running_distributed_tests/app_config.yaml @@ -7,7 +7,7 @@ python: pip_packages: - pytest - awscli - - gym>=0.21.0,<0.24.0 + - gym>=0.21.0,<0.24.1 conda_packages: [] post_build_cmds: diff --git a/release/long_running_tests/app_config.yaml b/release/long_running_tests/app_config.yaml index dddd7f3ba..32329e7a0 100755 --- a/release/long_running_tests/app_config.yaml +++ b/release/long_running_tests/app_config.yaml @@ -7,7 +7,7 @@ debian_packages: python: pip_packages: - - gym[atari]>=0.21.0,<0.24.0 + - "gym[atari]>=0.21.0,<0.24.1" - pytest - tensorflow conda_packages: [] @@ -15,7 +15,7 @@ python: post_build_cmds: - 'rm -r wrk || true && git clone https://github.com/wg/wrk.git /tmp/wrk && cd /tmp/wrk && make -j && sudo cp wrk /usr/local/bin' - pip3 install pytest || true - - pip3 install -U ray[all] gym[atari]>=0.21.0,<0.24.0 autorom[accept-rom-license] + - pip3 install -U ray[all] "gym[atari]>=0.21.0,<0.24.1" autorom[accept-rom-license] - pip3 install ray[all] # TODO (Alex): Ideally we would install all the dependencies from the new # version too, but pip won't be able to find the new version of ray-cpp. diff --git a/release/rllib_tests/app_config.yaml b/release/rllib_tests/app_config.yaml index 37a4d7276..0f8d19d2b 100755 --- a/release/rllib_tests/app_config.yaml +++ b/release/rllib_tests/app_config.yaml @@ -8,7 +8,7 @@ python: # These dependencies should be handled by requirements_rllib.txt and # requirements_ml_docker.txt pip_packages: - - gym>=0.21.0,<0.24.0 + - gym>=0.21.0,<0.24.1 conda_packages: [] post_build_cmds: diff --git a/release/tune_tests/cloud_tests/app_config.yaml b/release/tune_tests/cloud_tests/app_config.yaml index 476d3b9fc..7da6c47b6 100755 --- a/release/tune_tests/cloud_tests/app_config.yaml +++ b/release/tune_tests/cloud_tests/app_config.yaml @@ -8,7 +8,7 @@ python: - pytest - awscli - gsutil - - gym>=0.21.0,<0.24.0 + - gym>=0.21.0,<0.24.1 - gcsfs - pyarrow>=6.0.1,<7.0.0 conda_packages: [] diff --git a/release/tune_tests/cloud_tests/app_config_ml.yaml b/release/tune_tests/cloud_tests/app_config_ml.yaml index fd21e8d48..725b6d9aa 100755 --- a/release/tune_tests/cloud_tests/app_config_ml.yaml +++ b/release/tune_tests/cloud_tests/app_config_ml.yaml @@ -8,7 +8,7 @@ python: - pytest - awscli - gsutil - - gym>=0.21.0,<0.24.0 + - gym>=0.21.0,<0.24.1 - gcsfs - pyarrow>=6.0.1,<7.0.0 conda_packages: [] diff --git a/rllib/utils/pre_checks/env.py b/rllib/utils/pre_checks/env.py index 018da2e32..25a16eade 100644 --- a/rllib/utils/pre_checks/env.py +++ b/rllib/utils/pre_checks/env.py @@ -1,5 +1,6 @@ """Common pre-checks for all RLlib experiments.""" from copy import copy +import inspect import logging import gym import numpy as np @@ -146,6 +147,17 @@ def check_gym_environments(env: gym.Env) -> None: "to infinity, and your environment will not be " "reset." ) + # Raise warning if using new reset api introduces in gym 0.24 + reset_signature = inspect.signature(env.unwrapped.reset).parameters.keys() + if any(k in reset_signature for k in ["seed", "return_info"]): + if log_once("reset_signature"): + logger.warning( + "Your env reset() method appears to take 'seed' or 'return_info'" + " arguments. Note that these are not yet supported in RLlib." + " Seeding will take place using 'env.seed()' and the info dict" + " will not be returned from reset." + ) + # check if sampled actions and observations are contained within their # respective action and observation spaces.