diff --git a/gym/wrappers/pixel_observation.py b/gym/wrappers/pixel_observation.py index 6d70d4657e1..9a863c4b1f0 100644 --- a/gym/wrappers/pixel_observation.py +++ b/gym/wrappers/pixel_observation.py @@ -7,7 +7,7 @@ import numpy as np import gym -from gym import logger, spaces +from gym import spaces STATE_KEY = "state" @@ -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')`." )