Skip to content

Commit

Permalink
[BugFix] Raise exception in PixelObservationWrapper if env.render_mod…
Browse files Browse the repository at this point in the history
…e is not specified (#3076)

* init

* amend
  • Loading branch information
vmoens authored Sep 8, 2022
1 parent 824507b commit abefea7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gym/wrappers/pixel_observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np

import gym
from gym import logger, spaces
from gym import spaces

STATE_KEY = "state"

Expand Down Expand Up @@ -95,8 +95,7 @@ def __init__(

default_render_kwargs = {}
if not env.render_mode:
default_render_kwargs = {"mode": "rgb_array_list"}
logger.warn(
raise AttributeError(
"env.render_mode must be specified to use PixelObservationWrapper:"
"`gym.make(env_name, render_mode='rgb_array')`."
)
Expand Down

0 comments on commit abefea7

Please sign in to comment.