Bump gym dep to 0.24 (#26190)

Co-authored-by: Steven Morad <smorad@anyscale.com>
Co-authored-by: Avnish <avnishnarayan@gmail.com>
Co-authored-by: Avnish Narayan <38871737+avnishn@users.noreply.github.com>
This commit is contained in:
Steven Morad 2022-07-22 20:37:16 +01:00 committed by GitHub
parent a03716e75f
commit 259429bdc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 7 deletions

View file

@ -4,7 +4,7 @@
# --------------------- # ---------------------
# Atari # Atari
autorom[accept-rom-license] 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' gym[atari]==0.19.0; python_version < '3.7'
# Kaggle envs. # Kaggle envs.
kaggle_environments==1.7.11 kaggle_environments==1.7.11

View file

@ -7,7 +7,7 @@ python:
pip_packages: pip_packages:
- pytest - pytest
- awscli - awscli
- gym>=0.21.0,<0.24.0 - gym>=0.21.0,<0.24.1
conda_packages: [] conda_packages: []
post_build_cmds: post_build_cmds:

View file

@ -7,7 +7,7 @@ debian_packages:
python: python:
pip_packages: pip_packages:
- gym[atari]>=0.21.0,<0.24.0 - "gym[atari]>=0.21.0,<0.24.1"
- pytest - pytest
- tensorflow - tensorflow
conda_packages: [] conda_packages: []
@ -15,7 +15,7 @@ python:
post_build_cmds: 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' - '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 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] - pip3 install ray[all]
# TODO (Alex): Ideally we would install all the dependencies from the new # 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. # version too, but pip won't be able to find the new version of ray-cpp.

View file

@ -8,7 +8,7 @@ python:
# These dependencies should be handled by requirements_rllib.txt and # These dependencies should be handled by requirements_rllib.txt and
# requirements_ml_docker.txt # requirements_ml_docker.txt
pip_packages: pip_packages:
- gym>=0.21.0,<0.24.0 - gym>=0.21.0,<0.24.1
conda_packages: [] conda_packages: []
post_build_cmds: post_build_cmds:

View file

@ -8,7 +8,7 @@ python:
- pytest - pytest
- awscli - awscli
- gsutil - gsutil
- gym>=0.21.0,<0.24.0 - gym>=0.21.0,<0.24.1
- gcsfs - gcsfs
- pyarrow>=6.0.1,<7.0.0 - pyarrow>=6.0.1,<7.0.0
conda_packages: [] conda_packages: []

View file

@ -8,7 +8,7 @@ python:
- pytest - pytest
- awscli - awscli
- gsutil - gsutil
- gym>=0.21.0,<0.24.0 - gym>=0.21.0,<0.24.1
- gcsfs - gcsfs
- pyarrow>=6.0.1,<7.0.0 - pyarrow>=6.0.1,<7.0.0
conda_packages: [] conda_packages: []

View file

@ -1,5 +1,6 @@
"""Common pre-checks for all RLlib experiments.""" """Common pre-checks for all RLlib experiments."""
from copy import copy from copy import copy
import inspect
import logging import logging
import gym import gym
import numpy as np import numpy as np
@ -146,6 +147,17 @@ def check_gym_environments(env: gym.Env) -> None:
"to infinity, and your environment will not be " "to infinity, and your environment will not be "
"reset." "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 # check if sampled actions and observations are contained within their
# respective action and observation spaces. # respective action and observation spaces.