From b699b521d4759c2a4b35be29227777edf9f6c7f1 Mon Sep 17 00:00:00 2001 From: takuseno Date: Sat, 12 Oct 2024 15:12:23 +0900 Subject: [PATCH] Upgrade Gymanasium to v1.0.0 --- d3rlpy/datasets.py | 2 +- examples/deepmind_control.py | 6 +++--- requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/d3rlpy/datasets.py b/d3rlpy/datasets.py index bf383437..937fe141 100644 --- a/d3rlpy/datasets.py +++ b/d3rlpy/datasets.py @@ -13,7 +13,7 @@ from gym.wrappers.time_limit import TimeLimit from gymnasium.spaces import Box as GymnasiumBox from gymnasium.spaces import Dict as GymnasiumDictSpace -from gymnasium.wrappers.time_limit import TimeLimit as GymnasiumTimeLimit +from gymnasium.wrappers import TimeLimit as GymnasiumTimeLimit from .dataset import ( BasicTrajectorySlicer, diff --git a/examples/deepmind_control.py b/examples/deepmind_control.py index 32979114..92c234db 100644 --- a/examples/deepmind_control.py +++ b/examples/deepmind_control.py @@ -1,7 +1,7 @@ import argparse import gymnasium -from gymnasium.wrappers.flatten_observation import FlattenObservation +from gymnasium.wrappers import FlattenObservation import d3rlpy @@ -21,8 +21,8 @@ def main() -> None: args = parser.parse_args() env_id = f"dm_control/{args.env}" - env = FlattenObservation(gymnasium.make(env_id)) - eval_env = FlattenObservation(gymnasium.make(env_id)) + env = FlattenObservation(gymnasium.make(env_id)) # type: ignore + eval_env = FlattenObservation(gymnasium.make(env_id)) # type: ignore # fix seed d3rlpy.seed(args.seed) diff --git a/requirements.txt b/requirements.txt index d5f568d4..e2514a46 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ click==8.0.1 typing-extensions==3.7.4.3 structlog==20.2.0 colorama==0.4.4 -gymnasium==0.29.0 +gymnasium==1.0.0 diff --git a/setup.py b/setup.py index b67a26f8..1b6c90ce 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ "structlog", "colorama", "dataclasses-json", - "gymnasium", + "gymnasium>=1.0.0", ], packages=find_packages(exclude=["tests*"]), python_requires=">=3.8.0",