You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see you provide the option to disable rendering, which is useful when working with Jupyter notebooks. However, if you try to do that, you will find that there is a serious bug in the code that prevents this feature:
import gym_maze
gym.envs.registration.register(
id="maze-sample-5x5-v0-no-render",
entry_point="gym_maze.envs:MazeEnvSample5x5",
max_episode_steps=2000,
kwargs={
"enable_render": False
}
)
env = gym.make("maze-sample-5x5-v0-no-render")
obs, info = env.reset()
img = env.render(mode="rgb_array") # AttributeError: 'MazeView2D' object has no attribute 'screen'
The issue is that you create the 'screen' field only when 'enable_render' is set to 'True,' but the '__view_update(self, mode)' method is called at all times, and it uses the 'screen' field internally.
Hey, I've made a pull request but since this repo is basically inactive it is unlikely to get accepted. However, the code with the fix is available on my profile. Good luck!
I see you provide the option to disable rendering, which is useful when working with Jupyter notebooks. However, if you try to do that, you will find that there is a serious bug in the code that prevents this feature:
The issue is that you create the 'screen' field only when 'enable_render' is set to 'True,' but the '__view_update(self, mode)' method is called at all times, and it uses the 'screen' field internally.
Path: gym_maze > envs > MazeView2D > init
Path: gym_maze > envs > MazeView2D > __view_update
Path: gym_maze > envs > MazeView2D > update
The text was updated successfully, but these errors were encountered: