squadrick
squadrick

Reputation: 770

Why does OpenAI Gym Atari give a wrong observation while rendering?

Screenshot

This is what env.render() outputs on the screen, the environment is SpaceInvader-v0.

Am I doing something wrong here? My code is literally right off the OpenAI Gym website, only changed the environment.

Upvotes: 1

Views: 1369

Answers (2)

Nikita Kniazev
Nikita Kniazev

Reputation: 3785

Your gym and atari_py versions are incompatible (atari_py >= 0.1.1 requires gym >= 0.9.5).

The openai devs introduced getScreenRGB2 API call and changed gym to use it after my call that getScreenRGB is actually returns data not in RGB but in BGRX format and latter channel swapping in gym eats a lot of CPU cycles.

Upvotes: 1

user2721897
user2721897

Reputation: 367

I had the same issue and just figured it out (hopefully it's the same issue as yours). I had installed gym==0.7.0 and all I could get is a jumbled screen. When I upgraded to the latest gym (0.9.x), everything now looks correct. You may have to modify some code to adapt to the version switch.

Upvotes: 2

Related Questions