Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump gym dep to 0.24 #26190

Merged
merged 5 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/requirements/ml/requirements_rllib.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion release/long_running_distributed_tests/app_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions release/long_running_tests/app_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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: []

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.
Expand Down
2 changes: 1 addition & 1 deletion release/rllib_tests/app_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion release/tune_tests/cloud_tests/app_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
2 changes: 1 addition & 1 deletion release/tune_tests/cloud_tests/app_config_ml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
12 changes: 12 additions & 0 deletions rllib/utils/pre_checks/env.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.

Expand Down