google-research/football

Unable to get 'pixels' representation without render=True

ChintanTrivedi opened this issue · 5 comments

import gfootball.env as football_env
env = football_env.create_environment(env_name='academy_empty_goal_close',representation='pixels')
env.reset()

This gives the following:-

  File "<ipython-input-2-3ae6753bad3b>", line 3, in <module>
    env.reset()
  File "/home/chintan/anaconda3/lib/python3.7/site-packages/gym/core.py", line 255, in reset
    return self.observation(observation)
  File "/home/chintan/anaconda3/lib/python3.7/site-packages/gfootball/env/wrappers.py", line 153, in observation
    frame = obs['frame']
KeyError: 'frame'

This works when I switch to a different representation like simple115 or SMM. What am I missing, please?

EDIT: Ok, I noticed setting render=True makes the frame available. I would like to get the frame without rendering, is that possible?

The frames are composed of pixels which should only be available by rendering it. So no I guess?

cyfra commented

Yes, you need rendering to see the pixels. You can also render to the framebuffer - this way you can run multiple environments at once and don't display things on your monitor.
See #27 for details.

Thanks.

With that server running, I'm seeing

[FATAL ERROR !!! N00000 !!!] in [OpenGLRenderer3D::LoadShader]: 1Could not compile vertex program: simple
Segmentation fault (core dumped)

Also seeing warnings

[Warning] in [::LoadGLShader]: shader compilation info (media/shaders/simple.vert):
0:1(10): error: GLSL 1.50 is not supported.
cyfra commented

Rendering to framebuffer has probably changed your driver to use MESA.

Try:
MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 python3 -m gfootball.play_game

Thank you, this worked.