Why does OpenAI Gym Atari give a wrong observation

2019-07-23 06:26发布

问题:

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.

回答1:

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.



回答2:

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.



标签: openai-gym