Search code examples
openai-gym

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.


Solution

  • 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.