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