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

Deadly 提交于 2019-12-11 06:34:17

问题


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.



来源:https://stackoverflow.com/questions/44409176/why-does-openai-gym-atari-give-a-wrong-observation-while-rendering

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!