From 2d594803636e341660cab0e81343abbe9a325353 Mon Sep 17 00:00:00 2001 From: Avishai Halev <67072238+ahalev@users.noreply.github.com> Date: Tue, 3 Jan 2023 22:06:27 -0800 Subject: [PATCH] render_modes compatability with gym>0.17.3 (#2334) --- src/garage/envs/gym_env.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/garage/envs/gym_env.py b/src/garage/envs/gym_env.py index 321fe0ecaa..3c6ec01265 100644 --- a/src/garage/envs/gym_env.py +++ b/src/garage/envs/gym_env.py @@ -144,7 +144,10 @@ def __init__(self, env, is_image=False, max_episode_length=None): self._max_episode_length = _get_time_limit(self._env, max_episode_length) - self._render_modes = self._env.metadata['render.modes'] + try: + self._render_modes = self._env.metadata['render_modes'] + except KeyError: + self._render_modes = self._env.metadata['render.modes'] self._step_cnt = None self._visualize = False