Git Product home page Git Product logo

football's Introduction

Google Research Football

This repository contains an RL environment based on open-source game Gameplay Football.
It was created by the Google Brain team for research purposes.

Useful links:

We'd like to thank Bastiaan Konings Schuiling, who authored and open-sourced the original version of this game.

Quick Start

In colab

Open our example Colab, that will allow you to start training your model in less than 2 minutes.

This method doesn't support game rendering on screen - if you want to see the game running, please use the method below.

Using Docker

This is the recommended way for Linux-based systems to avoid incompatible package versions. Instructions are available here.

On your computer

1. Install required packages

Linux

sudo apt-get install git cmake build-essential libgl1-mesa-dev libsdl2-dev \
libsdl2-image-dev libsdl2-ttf-dev libsdl2-gfx-dev libboost-all-dev \
libdirectfb-dev libst-dev mesa-utils xvfb x11vnc python3-pip

python3 -m pip install --upgrade pip setuptools psutil wheel

macOS

First install brew. It should automatically install Command Line Tools. Next install required packages:

brew install git python3 cmake sdl2 sdl2_image sdl2_ttf sdl2_gfx boost boost-python3

python3 -m pip install --upgrade pip setuptools psutil wheel

Windows

Install Git and Python 3. Update pip in the Command Line (here and for the next steps type python instead of python3)

python -m pip install --upgrade pip setuptools psutil wheel

2. Install GFootball

Option a. From PyPi package (recommended)

python3 -m pip install gfootball

Option b. Installing from sources using GitHub repository

(On Windows you have to install additional tools and set an environment variable, see Compiling Engine for detailed instructions.)

git clone https://github.com/google-research/football.git
cd football

Optionally you can use virtual environment:

python3 -m venv football-env
source football-env/bin/activate

Next, build the game engine and install dependencies:

python3 -m pip install .

This command can run for a couple of minutes, as it compiles the C++ environment in the background. If you face any problems, first check Compiling Engine documentation and search GitHub issues.

3. Time to play!

python3 -m gfootball.play_game --action_set=full

Make sure to check out the keyboard mappings. To quit the game press Ctrl+C in the terminal.

Contents

Training agents to play GRF

Run training

In order to run TF training, you need to install additional dependencies

  • Update PIP, so that tensorflow 1.15 is available: python3 -m pip install --upgrade pip setuptools wheel
  • TensorFlow: python3 -m pip install tensorflow==1.15.* or python3 -m pip install tensorflow-gpu==1.15.*, depending on whether you want CPU or GPU version;
  • Sonnet and psutil: python3 -m pip install dm-sonnet==1.* psutil;
  • OpenAI Baselines: python3 -m pip install git+https://github.com/openai/baselines.git@master.

Then:

  • To run example PPO experiment on academy_empty_goal scenario, run python3 -m gfootball.examples.run_ppo2 --level=academy_empty_goal_close
  • To run on academy_pass_and_shoot_with_keeper scenario, run python3 -m gfootball.examples.run_ppo2 --level=academy_pass_and_shoot_with_keeper

In order to train with nice replays being saved, run python3 -m gfootball.examples.run_ppo2 --dump_full_episodes=True --render=True

In order to reproduce PPO results from the paper, please refer to:

  • gfootball/examples/repro_checkpoint_easy.sh
  • gfootball/examples/repro_scoring_easy.sh

Playing the game

Please note that playing the game is implemented through an environment, so human-controlled players use the same interface as the agents. One important implication is that there is a single action per 100 ms reported to the environment, which might cause a lag effect when playing.

Keyboard mappings

The game defines following keyboard mapping (for the keyboard player type):

  • ARROW UP - run to the top.
  • ARROW DOWN - run to the bottom.
  • ARROW LEFT - run to the left.
  • ARROW RIGHT - run to the right.
  • S - short pass in the attack mode, pressure in the defense mode.
  • A - high pass in the attack mode, sliding in the defense mode.
  • D - shot in the attack mode, team pressure in the defense mode.
  • W - long pass in the attack mode, goalkeeper pressure in the defense mode.
  • Q - switch the active player in the defense mode.
  • C - dribble in the attack mode.
  • E - sprint.

Play vs built-in AI

Run python3 -m gfootball.play_game --action_set=full. By default, it starts the base scenario and the left player is controlled by the keyboard. Different types of players are supported (gamepad, external bots, agents...). For possible options run python3 -m gfootball.play_game -helpfull.

Play vs pre-trained agent

In particular, one can play against agent trained with run_ppo2 script with the following command (notice no action_set flag, as PPO agent uses default action set): python3 -m gfootball.play_game --players "keyboard:left_players=1;ppo2_cnn:right_players=1,checkpoint=$YOUR_PATH"

Trained checkpoints

We provide trained PPO checkpoints for the following scenarios:

In order to see the checkpoints playing, run python3 -m gfootball.play_game --players "ppo2_cnn:left_players=1,policy=gfootball_impala_cnn,checkpoint=$CHECKPOINT" --level=$LEVEL, where $CHECKPOINT is the path to downloaded checkpoint. Please note that the checkpoints were trained with Tensorflow 1.15 version. Using different Tensorflow version may result in errors. The easiest way to run these checkpoints is through provided Dockerfile_examples image. See running in docker for details (just override the default Docker definition with -f Dockerfile_examples parameter).

In order to train against a checkpoint, you can pass 'extra_players' argument to create_environment function. For example extra_players='ppo2_cnn:right_players=1,policy=gfootball_impala_cnn,checkpoint=$CHECKPOINT'.

football's People

Contributors

antonraichuk avatar avikj avatar ayoubkachkach avatar boscotsang avatar cstankonrad avatar dcorneal avatar dongr0510 avatar fbudrowski avatar gkkurach avatar joybanerjee08 avatar keshavgbpecdelhi avatar mcguires5 avatar pkozakowski avatar qstanczyk avatar rajpratik71 avatar sahil-rajput avatar slowy07 avatar ttumiel avatar vi3itor avatar wdomitrz avatar yoanisgil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

football's Issues

Can not find e_BackendAction in python

python3 -m gfootball.play_game
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/zhaoliu/Desktop/google-football/gfootball/play_game.py", line 18, in
from gfootball.env import football_env
File "/home/zhaoliu/Desktop/google-football/gfootball/env/init.py", line 24, in
from gfootball.env import football_env
File "/home/zhaoliu/Desktop/google-football/gfootball/env/football_env.py", line 27, in
from gfootball.env import football_action_set
File "/home/zhaoliu/Desktop/google-football/gfootball/env/football_action_set.py", line 25, in
from gfootball_engine import e_BackendAction
ImportError: cannot import name 'e_BackendAction'

pip version 18.1

I've compiled it in Ubuntu 18.04.2, but I can not run it.

Python Core Dumped

I am trying to run the commands in python as described in the paper.
env = football_env.create_environment(env_name='11_vs_11_stochastic',render=True)
env.reset()
done = False
while not done:
action = env.action_space.sample()
observation, reward, done, info = env.step(action)
But every time I get the same error

python3: /tmp/pip-build-8hrcw4hm/gfootball/third_party/gfootball_engine/src/base/utils.cpp:244: blunted::Vector3 blunted::GetVectorFromString(const string&): Assertion `tokenizedString.size() <= 3' failed.
Aborted (core dumped)

Error when Playing game yourself: ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred,etc

Dear Sir/Madam,
After I input MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 python3 -m gfootball.play_game, Google Research Football will run normally in a period. However, the interface is grey from the beginning, not as colorful as what your paper reveals. Besides, the program will be forced to exit after a while, but it is not completed yet.

root@lzc-virtual-machine:/home/lzc/football# MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 python3 -m gfootball.play_game
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
已杀死

What happened to my program? My platform is a ubuntu linux virtual machine. What changes need I make? Could you please help me solve it? Many thanks to your kind attention.

Unable to retrieve "sticky_actions" when executing the game with built-in AIs

Hi @zajaczajac
Thank you for the reply on #40 , that worked.

Now, I am trying to extract some information about the players, specifically the sticky_actions.
If I run the command you suggested above MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 python3 -m gfootball.play_game --home_players= --away_players= the game works but no information about the players actions is exposed (not even internally in the source code, from what I can see) since there is no active player in any team.

How can I specify the built-in AI in the --home_team= and --away_team= arguments when I run the game?

Error during installation: process is killed

Hi! I'm trying to install football for a project. I'm using VMWare with Ubuntu 18.04 (4gb RAM, 2 cores processor and 30GB of disk space). When I run pip3 install .[tf_gpu] the process gets stuck in "running setup.py install for gfootball" and after a minute it gets killed and the OS restarts. Can someone tell me why is this happening? Or if football is compatible with VMWare virtual machine. Thanks for your help.

error: XDG_RUNTIME_DIR not set in the environment. Couldn't load GL function glBegin: Video subsystem has not been initialized

root@b7e2aa424caa:/gfootball# python3 -m gfootball.play_game /usr/local/lib/python3.6/dist-packages/google/protobuf/__init__.py:37: UserWarning: Module gfootball_engine was already imported from /usr/local/lib/python3.6/dist-packages/gfootball_engine/__init__.py, but /gfootball is being added to sys.path __import__('pkg_resources').declare_namespace(__name__) pygame 1.9.6 Hello from the pygame community. https://www.pygame.org/contribute.html ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default error: XDG_RUNTIME_DIR not set in the environment. Couldn't load GL function glBegin: Video subsystem has not been initialized

after entering images, it is ok to run python3 -m football.examples.run_ppo2,but I have error when I run python3 -m gfootball.play_game.do you know the reason? thx~

[Ubuntu 16.04] libGL error when trying to play the game

when I run the python3 -m gfootball.play_game , error shows that:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Couldn't load GL function glBegin: No GL driver has been loaded

Also happen in python3 -m gfootball.examples.run_ppo2 --dump_full_episodes=True --render=True
But when I try another pygame example python3 -m pygame.examples.aliens , it works

How to control the viewpoint?

Hi,

I am interested in modifying the cameras viewpoint. Instead of the camera always looking at the player, to have it show the entire field (and not move..).
Any easy way to do that ? If not, any tips on which files I might need to modify?

Unable to get 'pixels' representation without render=True

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?

No matching distribution found for baselines>=0.1.6

Could not find a version that satisfies the requirement baselines>=0.1.6 (from gfootball[tf_gpu]) (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5)

Can only install 0.1.5 even with the suggestion in issue #1. Using 18.04.2 LTS platform.

ModuleNotFoundError: No module named 'gfootball_engine' from Docker Images

I installed manually baselines from openia git repo using

pip3 install "git+https://github.com/openai/baselines.git@master#egg=baselines-0.1.6"

ThenI try to run the example and it fails

root@2cf8b1eea328:/gfootball# python3 -m gfootball.play_game
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/gfootball/gfootball/play_game.py", line 18, in
from gfootball.env import football_env
File "/gfootball/gfootball/env/init.py", line 23, in
from gfootball.env import config
File "/gfootball/gfootball/env/config.py", line 28, in
import gfootball_engine as libgame
ModuleNotFoundError: No module named 'gfootball_engine'

How can Installed the missed module ?
do you recommend to re-run all te pip install module by hand ?

Thanks!

Docker Images

Prebuilded Docker images ;

gumush/gfootball_gpu:latest
gumush/gfootball:latest

docker run -it gumush/gfootball:latest bash 
python3 -m gfootball.examples.run_ppo2

Docker build failed

When I run the docker build command I got the following error

Installing collected packages: click, cloudpickle, future, pyglet, scipy, gym, joblib, opencv-python, tqdm, baselines, pygame, gfootball
Running setup.py install for baselines: started
Running setup.py install for baselines: finished with status 'done'
Running setup.py install for gfootball: started
The command '/bin/sh -c cd /gfootball && pip3 install .[tf_$DEVICE] --process-dependency-links' returned a non-zero code: 137

Is there any API to control multiple player?

I want to control multiple player by different policy at same time, and I find this
line self._env.perform_action(action, self._home_team, self._player_id) in the football_env_core.py, but it seems not work to change the self._player_id.

Rendering not working

I got the following error every time I need to render the environment.

$ python3 -m gfootball.play_game
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Mon Jun 10 14:51:49 2019 [Warning] in [OpenGLRenderer3D::CreateContext]: OpenGL version not equal to or higher than 3.2 (or not reported as such)
shader compilation error (media/shaders/simple.vert)
Mon Jun 10 14:51:49 2019 [Warning] in [::LoadGLShader]: shader compilation error (media/shaders/simple.vert)
shader compilation info: 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES

Mon Jun 10 14:51:49 2019 [Warning] in [::LoadGLShader]: shader compilation info (media/shaders/simple.vert):
0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES

0 1
Mon Jun 10 14:51:49 2019 [FATAL ERROR !!! N00000 !!!] in [OpenGLRenderer3D::LoadShader]: 1Could not compile vertex program: simple
Fatal Python error: Segmentation fault

QUESTION: Switching player action and auto-swtich

According to the paper, switching action is disabled during training, because it may return control to default bot. So, active player is auto-switched in defense mode, and manually switched according to passing in attack mode. I try to switch players in defense mode of play_game, but it seems not working as I expected.

How does it (auto-switch) work? Can we turn off this auto-switch by modifying config or code?

Failed to build baselines

root@f869a41fc79e:/home/baselines# pip3 install "git+https://github.com/openai/baselines.git@master#egg=baselines-0.1.6"
Collecting baselines-0.1.6 from git+https://github.com/openai/baselines.git@master#egg=baselines-0.1.6
Cloning https://github.com/openai/baselines.git (to revision master) to /tmp/pip-install-fai6zwi2/baselines-0.1.6
Running command git clone -q https://github.com/openai/baselines.git /tmp/pip-install-fai6zwi2/baselines-0.1.6
WARNING: Generating metadata for package baselines-0.1.6 produced metadata for project name baselines. Fix your #egg=baselines-0.1.6 fragments.
Requirement already satisfied (use --upgrade to upgrade): baselines from git+https://github.com/openai/baselines.git@master#egg=baselines-0.1.6 in /home/baselines
Requirement already satisfied: click in /usr/local/lib/python3.6/dist-packages (from baselines) (7.0)
Requirement already satisfied: cloudpickle in /usr/local/lib/python3.6/dist-packages (from baselines) (1.2.1)
Requirement already satisfied: gym<1.0.0,>=0.10.0 in /usr/local/lib/python3.6/dist-packages/gym-0.12.5-py3.6.egg (from baselines) (0.12.5)
Requirement already satisfied: joblib in /usr/local/lib/python3.6/dist-packages (from baselines) (0.13.2)
Requirement already satisfied: opencv-python in /usr/local/lib/python3.6/dist-packages/opencv_python-4.1.0.25-py3.6-linux-x86_64.egg (from baselines) (4.1.0.25)
Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages/scipy-1.3.0-py3.6-linux-x86_64.egg (from baselines) (1.3.0)
Requirement already satisfied: tqdm in /usr/local/lib/python3.6/dist-packages (from baselines) (4.32.1)
Requirement already satisfied: numpy>=1.10.4 in /usr/local/lib/python3.6/dist-packages (from gym<1.0.0,>=0.10.0->baselines) (1.16.4)
Requirement already satisfied: pyglet>=1.2.0 in /usr/local/lib/python3.6/dist-packages (from gym<1.0.0,>=0.10.0->baselines) (1.3.2)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from gym<1.0.0,>=0.10.0->baselines) (1.11.0)
Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from pyglet>=1.2.0->gym<1.0.0,>=0.10.0->baselines) (0.17.1)
Building wheels for collected packages: baselines, baselines
Building wheel for baselines (setup.py) ... done
Stored in directory: /tmp/pip-ephem-wheel-cache-1vc90d02/wheels/47/4b/a3/0a25aebc24e2f3302802b56aef9855b3bc7bb051cc5bc3debd
Building wheel for baselines (setup.py) ... error
ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-fai6zwi2/baselines/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', op
en)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-48qo3hxs --python-tag cp36:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.6/tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-fai6zwi2/baselines/setup.py'

ERROR: Failed building wheel for baselines
Running setup.py clean for baselines
ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-fai6zwi2/baselines/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', op
en)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' clean --all:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.6/tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-fai6zwi2/baselines/setup.py'

ERROR: Failed cleaning build dir for baselines
Successfully built baselines
Failed to build baselines

Models not being saved

I have been trying to run an A3C chainer script on the environment and although the learning is taking place and is evident in the rendering but the model is not being saved.
When I replace the environment with Cartpole it works fine and the model gets saved.
Could you please update?

TypeError running random agent in academy_empty_goal_close scenario

Hi. I was trying to run an example of a random agent being implemented. But I get the following error:
TypeError Traceback (most recent call last)
in
1 for i in range(1, 10):
----> 2 env.reset()
3 acc_reward = 0
4
5 while True:

~/anaconda3/envs/football/lib/python3.7/site-packages/gym/core.py in reset(self, **kwargs)
268 class RewardWrapper(Wrapper):
269 def reset(self, **kwargs):
--> 270 return self.env.reset(**kwargs)
271
272 def step(self, action):

~/anaconda3/envs/football/lib/python3.7/site-packages/gym/core.py in reset(self, **kwargs)
255 class ObservationWrapper(Wrapper):
256 def reset(self, **kwargs):
--> 257 observation = self.env.reset(**kwargs)
258 return self.observation(observation)
259

~/anaconda3/envs/football/lib/python3.7/site-packages/gym/core.py in reset(self, **kwargs)
256 def reset(self, **kwargs):
257 observation = self.env.reset(**kwargs)
--> 258 return self.observation(observation)
259
260 def step(self, action):

~/anaconda3/envs/football/lib/python3.7/site-packages/gfootball/env/wrappers.py in observation(self, obs)
78 """
79 final_obs = []
---> 80 for a in obs['active']:
81 o = []
82 o.extend(obs['left_team'].flatten())

TypeError: list indices must be integers or slices, not str

Could you tell me the reason of this error? Thanks!

C++ Compilation Error with --no-pie

c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/strategy.cpp.o] Error 1
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/player/controller/elizacontroller.cpp.o
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_mid.cpp.o
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_def.cpp.o
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/special/celebration.cpp.o
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_off.cpp.o
c++: error: unrecognized command line option ‘-no-pie’
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/goalie_default.cpp.o
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/elizacontroller.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/ball.cpp.o
c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_mid.cpp.o] Error 1
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_def.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/AIfunctions.cpp.o
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/special/celebration.cpp.o] Error 1
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/humangamer.cpp.o
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/match.cpp.o
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/mentalimage.cpp.o
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/referee.cpp.o
c++: error: unrecognized command line option ‘-no-pie’
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/team.cpp.o
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_off.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/proceduralpitch.cpp.o
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/goalie_default.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/ball.cpp.o] Error 1
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/AIfunctions.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/humangamer.cpp.o] Error 1
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/mentalimage.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/match.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/proceduralpitch.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/referee.cpp.o] Error 1
c++: error: unrecognized command line option ‘-no-pie’
make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/team.cpp.o] Error 1
make[1]: *** [CMakeFiles/gamelib.dir/all] Error 2
make: *** [all] Error 2
gfootball/build_game_engine.sh: line 19: pushd: third_party/gfootball_engine: No such file or directory
build/lib.linux-x86_64-3.6/gfootball_engine
Google Research Football compilation failed
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-uga3s02v/setup.py'"'"'; file='"'"'/tmp/pip-req-build-uga3s02v/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-hj7022xr/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

The above is the snapshot of the error output, I'm running on Ubuntu14.04

Failed building wheel for gfootball

I am getting this error while installing

running build_ext
'gfootball' is not recognized as an internal or external command,
operable program or batch file.
Google Research Football compilation failed

Failed building wheel for gfootball
Running setup.py clean for gfootball
Running setup.py bdist_wheel for baselines ... done
Stored in directory: C:\Users\User\AppData\Local\Temp\pip-ephem-wheel-cache-2bdp8pkh\wheels\47\4b\a3\0a25aebc24e2f3302802b56aef9855b3bc7bb051cc5bc3debd
Running setup.py bdist_wheel for wrapt ... done
Stored in directory: C:\Users\User\AppData\Local\pip\Cache\wheels\d7\de\2e\efa132238792efb6459a96e85916ef8597fcb3d2ae51590dfd
Successfully built baselines wrapt
Failed to build gfootball
tensorflow 1.12.0 has requirement tensorboard<1.13.0,>=1.12.0, but you'll have tensorboard 1.14.0 which is incompatible.

Error during Installation: Boost not found

Hello, when running this step

pip3 install gfootball[tf_cpu]

I get an error like this (complete dump here):

CMake Error at CMakeLists.txt:72 (message): Python boost not found

But
dpkg -s libboost-dev | grep 'Version'
gives
Version: 1.65.1.0ubuntu1

Also /usr/include/boost/version.hpp shows it is indeed version 1.65.1
If it is of any help, my OS is Ubuntu 18.04.2.

Is there anything i'm missing? Thank you in advance

Docker build failed

When I run the docker build command I got the following error

Installing collected packages: click, cloudpickle, future, pyglet, scipy, gym, joblib, opencv-python, tqdm, baselines, pygame, gfootball
Running setup.py install for baselines: started
Running setup.py install for baselines: finished with status 'done'
Running setup.py install for gfootball: started
The command '/bin/sh -c cd /gfootball && pip3 install .[tf_$DEVICE] --process-dependency-links' returned a non-zero code: 137

"no matches found: gfootball[tf_cpu]" - possible problem with Conda environment?

Hi, I was just trying out the repo, and I got stuck at a simple point. Could someone please help me figure the problem out? I did the following:

  1. Do step 1 from under Installation. This prompted me to do sudo dpkg --configure -a which I did first, and then did that sudo apt install.

  2. That works, then since we are installing python packages, I thought it to be a good idea to create a new environment for step 2. So, I did:

    conda create -n googlefootball python=3.7 anaconda
    conda activate googlefootball
    
  3. Finally I did the step 2, pip3 install gfootball[tf_cpu] --process-dependency-link. But it gives this error:

    zsh: no matches found: gfootball[tf_cpu]
    

Where did I do wrong? Am I not supposed to use conda environments for this? Thanks!

ModuleNotFoundError: No module named 'gfootball_engine'and No module named 'apt-pkg'

I have installed the required apt packages like libgl1-mesa-dev and so on.
when I run the code "python3 -m gfootball.examples.run_ppo2 --level=academy_empty_goal_close", it has this mistake.
`Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/zyr/football-master/gfootball/examples/run_ppo2.py", line 27, in
import gfootball.env as football_env
File "/home/zyr/football-master/gfootball/env/init.py", line 23, in
from gfootball.env import config
File "/home/zyr/football-master/gfootball/env/config.py", line 28, in
import gfootball_engine as libgame
ModuleNotFoundError: No module named 'gfootball_engine'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in
import apt
File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/zyr/football-master/gfootball/examples/run_ppo2.py", line 27, in
import gfootball.env as football_env
File "/home/zyr/football-master/gfootball/env/init.py", line 23, in
from gfootball.env import config
File "/home/zyr/football-master/gfootball/env/config.py", line 28, in
import gfootball_engine as libgame
ModuleNotFoundError: No module named 'gfootball_engine'
'
so do you know where the bug is? thanks~

Running out of memory during installation

Installation fails at building wheel for gfootball. It seems to be due to out of memory error. Is there a way to limit memory / number of threads used during the installation?

I am running on Ubuntu 18.04 and have 16GB of RAM.

Error output:

[ 86%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/proceduralpitch.cpp.o
  virtual memory exhausted: Cannot allocate memory
  virtual memory exhausted: Cannot allocate memory
  virtual memory exhausted: Cannot allocate memory
  virtual memory exhausted: Cannot allocate memory
  CMakeFiles/menulib.dir/build.make:110: recipe for target 'CMakeFiles/menulib.dir/src/menu/menutask.cpp.o' failed
  make[2]: *** [CMakeFiles/menulib.dir/src/menu/menutask.cpp.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  CMakeFiles/gamelib.dir/build.make:62: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/officials.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/officials.cpp.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  CMakeFiles/gamelib.dir/build.make:446: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_off.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/default_off.cpp.o] Error 1
  CMakeFiles/gamelib.dir/build.make:158: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/humanoid.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/humanoid.cpp.o] Error 1
  virtual memory exhausted: Cannot allocate memory
  virtual memory exhausted: Cannot allocate memory
  CMakeFiles/datalib.dir/build.make:110: recipe for target 'CMakeFiles/datalib.dir/src/data/teamdata.cpp.o' failed
  make[2]: *** [CMakeFiles/datalib.dir/src/data/teamdata.cpp.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  CMakeFiles/systemsgraphicslib.dir/build.make:158: recipe for target 'CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/objects/graphics_light.cpp.o' failed
  make[2]: *** [CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/objects/graphics_light.cpp.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  virtual memory exhausted: Cannot allocate memory
  virtual memory exhausted: Cannot allocate memory
  CMakeFiles/gamelib.dir/build.make:86: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/humanoid_utils.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/humanoid_utils.cpp.o] Error 1
  CMakeFiles/gamelib.dir/build.make:350: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/controller/elizacontroller.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/elizacontroller.cpp.o] Error 1
  virtual memory exhausted: Cannot allocate memory
  CMakeFiles/loaderslib.dir/build.make:86: recipe for target 'CMakeFiles/loaderslib.dir/src/loaders/aseloader.cpp.o' failed
  make[2]: *** [CMakeFiles/loaderslib.dir/src/loaders/aseloader.cpp.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  virtual memory exhausted: Cannot allocate memory
  CMakeFiles/gamelib.dir/build.make:686: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/team.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/team.cpp.o] Error 1
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/systemsgraphicslib.dir/build.make:206: recipe for target 'CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/graphics_scene.cpp.o' failed
  make[2]: *** [CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/graphics_scene.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/baselib.dir/build.make:326: recipe for target 'CMakeFiles/baselib.dir/src/base/math/bluntmath.cpp.o' failed
  make[2]: *** [CMakeFiles/baselib.dir/src/base/math/bluntmath.cpp.o] Error 4
  make[2]: *** Waiting for unfinished jobs....
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/systemsgraphicslib.dir/build.make:110: recipe for target 'CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/objects/graphics_geometry.cpp.o' failed
  make[2]: *** [CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/objects/graphics_geometry.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:230: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/playerbase.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/playerbase.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/scenelib.dir/build.make:374: recipe for target 'CMakeFiles/scenelib.dir/src/scene/resources/geometrydata.cpp.o' failed
  make[2]: *** [CMakeFiles/scenelib.dir/src/scene/resources/geometrydata.cpp.o] Error 4
  make[2]: *** Waiting for unfinished jobs....
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/menulib.dir/build.make:134: recipe for target 'CMakeFiles/menulib.dir/src/menu/menuscene.cpp.o' failed
  make[2]: *** [CMakeFiles/menulib.dir/src/menu/menuscene.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:206: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/player.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/player.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/menulib.dir/build.make:62: recipe for target 'CMakeFiles/menulib.dir/src/menu/startmatch/loadingmatch.cpp.o' failed
  make[2]: *** [CMakeFiles/menulib.dir/src/menu/startmatch/loadingmatch.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:182: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/playerofficial.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/playerofficial.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:494: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/goalie_default.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/strategies/offtheball/goalie_default.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gui2lib.dir/build.make:86: recipe for target 'CMakeFiles/gui2lib.dir/src/utils/gui2/widgets/caption.cpp.o' failed
  make[2]: *** [CMakeFiles/gui2lib.dir/src/utils/gui2/widgets/caption.cpp.o] Error 4
  make[2]: *** Waiting for unfinished jobs....
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/systemsgraphicslib.dir/build.make:86: recipe for target 'CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/graphics_task.cpp.o' failed
  make[2]: *** [CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/graphics_task.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/menulib.dir/build.make:86: recipe for target 'CMakeFiles/menulib.dir/src/menu/pagefactory.cpp.o' failed
  make[2]: *** [CMakeFiles/menulib.dir/src/menu/pagefactory.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:134: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/humanoidbase.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/humanoidbase.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/utilslib.dir/build.make:134: recipe for target 'CMakeFiles/utilslib.dir/src/utils/objectloader.cpp.o' failed
  make[2]: *** [CMakeFiles/utilslib.dir/src/utils/objectloader.cpp.o] Error 4
  make[2]: *** Waiting for unfinished jobs....
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gui2lib.dir/build.make:254: recipe for target 'CMakeFiles/gui2lib.dir/src/utils/gui2/guitask.cpp.o' failed
  make[2]: *** [CMakeFiles/gui2lib.dir/src/utils/gui2/guitask.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/frameworklib.dir/build.make:86: recipe for target 'CMakeFiles/frameworklib.dir/src/framework/scheduler.cpp.o' failed
  make[2]: *** [CMakeFiles/frameworklib.dir/src/framework/scheduler.cpp.o] Error 4
  make[2]: *** Waiting for unfinished jobs....
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gui2lib.dir/build.make:230: recipe for target 'CMakeFiles/gui2lib.dir/src/utils/gui2/windowmanager.cpp.o' failed
  make[2]: *** [CMakeFiles/gui2lib.dir/src/utils/gui2/windowmanager.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/baselib.dir/build.make:134: recipe for target 'CMakeFiles/baselib.dir/src/base/log.cpp.o' failed
  make[2]: *** [CMakeFiles/baselib.dir/src/base/log.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/menulib.dir/build.make:182: recipe for target 'CMakeFiles/menulib.dir/src/menu/ingame/gamepage.cpp.o' failed
  make[2]: *** [CMakeFiles/menulib.dir/src/menu/ingame/gamepage.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:110: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/animcollection.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/humanoid/animcollection.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:542: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/ball.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/ball.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:638: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/AIfunctions.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/AIfunctions.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:566: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/match.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/match.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:326: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/controller/refereecontroller.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/refereecontroller.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/managerslib.dir/build.make:62: recipe for target 'CMakeFiles/managerslib.dir/src/managers/scenemanager.cpp.o' failed
  make[2]: *** [CMakeFiles/managerslib.dir/src/managers/scenemanager.cpp.o] Error 4
  make[2]: *** Waiting for unfinished jobs....
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/scenelib.dir/build.make:302: recipe for target 'CMakeFiles/scenelib.dir/src/scene/scene3d/node.cpp.o' failed
  make[2]: *** [CMakeFiles/scenelib.dir/src/scene/scene3d/node.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/scenelib.dir/build.make:182: recipe for target 'CMakeFiles/scenelib.dir/src/scene/objects/geometry.cpp.o' failed
  make[2]: *** [CMakeFiles/scenelib.dir/src/scene/objects/geometry.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:710: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/teamAIcontroller.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/teamAIcontroller.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gui2lib.dir/build.make:110: recipe for target 'CMakeFiles/gui2lib.dir/src/utils/gui2/widgets/image.cpp.o' failed
  make[2]: *** [CMakeFiles/gui2lib.dir/src/utils/gui2/widgets/image.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/datalib.dir/build.make:86: recipe for target 'CMakeFiles/datalib.dir/src/data/playerdata.cpp.o' failed
  make[2]: *** [CMakeFiles/datalib.dir/src/data/playerdata.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/scenelib.dir/build.make:230: recipe for target 'CMakeFiles/scenelib.dir/src/scene/objects/joint.cpp.o' failed
  make[2]: *** [CMakeFiles/scenelib.dir/src/scene/objects/joint.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/baselib.dir/build.make:86: recipe for target 'CMakeFiles/baselib.dir/src/base/utils.cpp.o' failed
  make[2]: *** [CMakeFiles/baselib.dir/src/base/utils.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/systemsgraphicslib.dir/build.make:182: recipe for target 'CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/objects/graphics_overlay2d.cpp.o' failed
  make[2]: *** [CMakeFiles/systemsgraphicslib.dir/src/systems/graphics/objects/graphics_overlay2d.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/baselib.dir/build.make:62: recipe for target 'CMakeFiles/baselib.dir/src/base/sdl_surface.cpp.o' failed
  make[2]: *** [CMakeFiles/baselib.dir/src/base/sdl_surface.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/menulib.dir/build.make:158: recipe for target 'CMakeFiles/menulib.dir/src/menu/ingame/radar.cpp.o' failed
  make[2]: *** [CMakeFiles/menulib.dir/src/menu/ingame/radar.cpp.o] Error 4
  c++: internal compiler error: Killed (program cc1plus)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
  CMakeFiles/gamelib.dir/build.make:278: recipe for target 'CMakeFiles/gamelib.dir/src/onthepitch/player/controller/humancontroller.cpp.o' failed
  make[2]: *** [CMakeFiles/gamelib.dir/src/onthepitch/player/controller/humancontroller.cpp.o] Error 4
  [ 86%] Built target systemscommonlib
  [ 86%] Built target typeslib
  CMakeFiles/Makefile2:375: recipe for target 'CMakeFiles/frameworklib.dir/all' failed
  make[1]: *** [CMakeFiles/frameworklib.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....
  CMakeFiles/Makefile2:523: recipe for target 'CMakeFiles/loaderslib.dir/all' failed
  make[1]: *** [CMakeFiles/loaderslib.dir/all] Error 2
  CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/baselib.dir/all' failed
  make[1]: *** [CMakeFiles/baselib.dir/all] Error 2
  CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/scenelib.dir/all' failed
  make[1]: *** [CMakeFiles/scenelib.dir/all] Error 2
  CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/menulib.dir/all' failed
  make[1]: *** [CMakeFiles/menulib.dir/all] Error 2
  CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/datalib.dir/all' failed
  make[1]: *** [CMakeFiles/datalib.dir/all] Error 2
  CMakeFiles/Makefile2:449: recipe for target 'CMakeFiles/managerslib.dir/all' failed
  make[1]: *** [CMakeFiles/managerslib.dir/all] Error 2
  CMakeFiles/Makefile2:486: recipe for target 'CMakeFiles/gui2lib.dir/all' failed
  make[1]: *** [CMakeFiles/gui2lib.dir/all] Error 2
  CMakeFiles/Makefile2:412: recipe for target 'CMakeFiles/utilslib.dir/all' failed
  make[1]: *** [CMakeFiles/utilslib.dir/all] Error 2
  CMakeFiles/Makefile2:338: recipe for target 'CMakeFiles/gamelib.dir/all' failed
  make[1]: *** [CMakeFiles/gamelib.dir/all] Error 2
  CMakeFiles/Makefile2:215: recipe for target 'CMakeFiles/systemsgraphicslib.dir/all' failed
  make[1]: *** [CMakeFiles/systemsgraphicslib.dir/all] Error 2
  Makefile:83: recipe for target 'all' failed
  make: *** [all] Error 2
  gfootball/build_game_engine.sh: line 19: pushd: third_party/gfootball_engine: No such file or directory
  Google Research Football compilation failed
  
  ----------------------------------------
  Failed building wheel for gfootball

TypeError running PPO example

Hi,
I am trying to run the example PPO experiment. I get the following error.

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/gekinci/football/gfootball/examples/run_ppo2.py", line 112, in
train()
File "/home/gekinci/football/gfootball/examples/run_ppo2.py", line 94, in train
], context=None)
TypeError: init() got an unexpected keyword argument 'context'

I simply tried removing that parameter but, then I get:

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/gekinci/football/gfootball/examples/run_ppo2.py", line 112, in
train()
File "/home/gekinci/football/gfootball/examples/run_ppo2.py", line 108, in train
cliprange=FLAGS.cliprange)
TypeError: learn() got an unexpected keyword argument 'network'

Thıs one I couldn't tackle in any way.
Do you know how to fix this? Thanks in advance.

Error when Running experiments and Playing game yourself

Could you please help me solve the AttributeError: 'tuple' object has no attribute 'name'?

Running experiments

root@lzc-virtual-machine:/home/lzc/football# python3 -m gfootball.examples.run_ppo2 --level=academy_empty_goal_close
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/home/lzc/football/gfootball/init.py", line 23, in
for env_name in scenario_builder.all_scenarios():
File "/home/lzc/football/gfootball/env/scenario_builder.py", line 37, in all_scenarios
return [m.name for m in pkgutil.iter_modules([path])]
File "/home/lzc/football/gfootball/env/scenario_builder.py", line 37, in
return [m.name for m in pkgutil.iter_modules([path])]
AttributeError: 'tuple' object has no attribute 'name'

Playing game yourself

root@lzc-virtual-machine:/home/lzc/football# python3 -m gfootball.play_game
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/home/lzc/football/gfootball/init.py", line 23, in
for env_name in scenario_builder.all_scenarios():
File "/home/lzc/football/gfootball/env/scenario_builder.py", line 37, in all_scenarios
return [m.name for m in pkgutil.iter_modules([path])]
File "/home/lzc/football/gfootball/env/scenario_builder.py", line 37, in
return [m.name for m in pkgutil.iter_modules([path])]
AttributeError: 'tuple' object has no attribute 'name'

` @qstanczyk

Unable to start an environment instance for second time (gpu version)

I'm starting an environment (gpu) using the following code-

import gfootball.env as football_env
env = football_env.create_environment(env_name=’academy_corner’,render=True)
env.reset()

It renders successfully and runs as expected.

However, if I terminate this python process and initiate another with the terminal and run the same code again, env.reset() throws the following error:-

Traceback (most recent call last):
File "", line 1, in
File "/home/chintan/anaconda3/lib/python3.7/site-packages/gym/core.py", line 254, in reset
observation = self.env.reset(**kwargs)
File "/home/chintan/anaconda3/lib/python3.7/site-packages/gfootball/env/football_env.py", line 150, in reset
self._env.reset(config)
File "/home/chintan/anaconda3/lib/python3.7/site-packages/gfootball/env/football_env_wrapper.py", line 50, in reset
self._env.reset(config, self._trace)
File "/home/chintan/anaconda3/lib/python3.7/site-packages/gfootball/env/football_env_core.py", line 63, in reset
_engine.start_game(self._config.GameConfig())
File "/home/chintan/anaconda3/lib/python3.7/site-packages/gfootball/env/config.py", line 120, in GameConfig
cfg.high_quality = self['render']
Boost.Python.ArgumentError: Python argument types in
None.None(GameConfig, str)
did not match C++ signature:
None(GameConfig {lvalue}, bool)

Rebooting the OS seems to fix this issue, so I'm assuming it has something to do with the GPU being locked from the first run or something similar? I'm not too familiar with CPP.

Using Ubuntu 18.04, GTX1070 (driver 410), cuda 10.0, TF-gpu 1.13.1. Thanks!

Error when running game only among bots

Hello
For a project that I am working on, I am trying to execute the simulator without any learning agent but only among bots.
I am using this command to run the game:

alessandroserena@alessandroserena-VirtualBox:~/Desktop/football$ MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 python3 -m gfootball.play_game --home_players=bot --away_players=bot

The rendered window starts and as soon as the kick-off is done the game crashes with the following error:

/home/alessandroserena/.local/lib/python3.6/site-packages/google/protobuf/__init__.py:37: UserWarning: Module gfootball_engine was already imported from /home/alessandroserena/.local/lib/python3.6/site-packages/gfootball_engine/__init__.py, but /home/alessandroserena/Desktop/football is being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/alessandroserena/Desktop/football/gfootball/play_game.py", line 64, in <module>
    app.run(main)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/home/alessandroserena/Desktop/football/gfootball/play_game.py", line 55, in main
    _, _, done, _ = env.step(None)
  File "/home/alessandroserena/Desktop/football/gfootball/env/football_env.py", line 139, in step
    observation, reward, done = self._env.step(self._get_actions())
  File "/home/alessandroserena/Desktop/football/gfootball/env/football_env.py", line 129, in _get_actions
    adopted_obs = self._convert_observations(obs, False, i)
  File "/home/alessandroserena/Desktop/football/gfootball/env/football_env.py", line 117, in _convert_observations
    observations = observation_rotation.flip_observation(observations)
TypeError: flip_observation() missing 1 required positional argument: 'config'


Can someone please help me fix this error, or otherwise show me how to run a simulation between players that can play a "realistic" game?

Thanks a lot for creating this package
alexander3605

'baselines' missing / needs mujoco after issue #1 workaround

I was able to get it built with the change suggested in issue #1.

However, when trying to run python3 -m gfootball.play_game, I get ModuleNotFoundError: No module named 'baselines', and when I try to do pip3 install baselines, I get Exception: You appear to be missing MuJoCo.

I don't think I should need MuJoCo to get the football stuff running.

I'm on Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-50-generic x86_64)

Bug: Bots do not perform "shot" action

Hi

I am running the game only among bots with the following command
MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 python3 -m gfootball.play_game --home_players=bot --away_players=bot

What I have noticed is that, when a bot has the ball and is within the shooting range defined in bot.py, the shot action gets returned by the function _get_action but the player does not actually shoot and most of the time it just keeps running towards the goal.

Is this a known issue? How can I fix this?

running the game on deterministic mode

Hi,

I would like to run the game in deterministic mode, as described in the blog post:

Second, to investigate the impact of randomness, it can be run in both a stochastic mode (enabled by default), in which there is randomness in both the environment and opponent AI actions, and in a deterministic mode, where there is no randomness.

How can I enable this? Thanks in advance.

Bug: ball_owned_player and ball_owned_team

I have found some bugs on the two ball possession pieces of information that the system keeps track while using the system.

The two values are not always synced with each other. Ideally, when ball_owned_team is -1, so should be ball_owned_player. Vice-versa, when ball_owned_player is not -1 (i.e. a player has the ball) so should be ball_owned_team.

  1. During goal kicks both values are set to -1 while the keeper is standing still. When he starts moving ball_owned_player gets set to 0, while ball_owned_team is stuck at -1. IMO the two values should point to the team and the keeper who is doing the goal kick during all the "game steps" while the game_mode is set to 2 (goal kick)

  2. Right after the goal kick is performed, ball_owned_team is set to the keeper's team but ball_owned_player is set to -1

I suspect a similar situation occurs also on free kicks but I have not encountered any in my usage of the system

  1. When the keeper intercepts the ball, ball_owned_team gets set to the keeper's team value but ball_owned_player gets set to -1

Question: GameFPS/FPS/physics_frametime/graphics_frametime ?

There are two different FPS shown in the logging info. If I understand it correctly according to the code in https://github.com/google-research/football/blob/master/gfootball/env/football_env_wrapper.py#L84,

FPS = episode-step-count / total-episode-time
GameFPS = episode-step-count / time-past-in-game-engine

They are called F(rames)PS but they actually represent the step per second.

But there is also another variable in the engine code called 'physics_frametime' and 'graphics3d_frametime', as shown in https://github.com/google-research/football/blob/master/third_party/gfootball_engine/data/football.config#L24

Now I have 3 questions:

  1. What's the relationship between the FPS/GameFPS between the 'frametime' parameters?
  2. And how is the game interacting with the agent: does it run for certain frames and pause waiting for the action or does it run and just listening to the action as some sort of interruption?
  3. How does these parameters influence the performance of the game and the agent?

Thank you for your patience reading this long issue. Any comment is welcomed!

Segmentation fault when running play_game.py

python3 -m gfootball.play_game
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Fri Jun 28 18:05:17 2019 [Warning] in [OpenGLRenderer3D::CreateContext]: OpenGL version not equal to or higher than 3.2 (or not reported as such)
shader compilation error (media/shaders/simple.vert)
Fri Jun 28 18:05:17 2019 [Warning] in [::LoadGLShader]: shader compilation error (media/shaders/simple.vert)
shader compilation info: 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

Fri Jun 28 18:05:17 2019 [Warning] in [::LoadGLShader]: shader compilation info (media/shaders/simple.vert):
0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

0 1
Fri Jun 28 18:05:17 2019 [FATAL ERROR !!! N00000 !!!] in [OpenGLRenderer3D::LoadShader]: 1Could not compile vertex program: simple
Fatal Python error: Segmentation fault

Current thread 0x00007f566f25a700 (most recent call first):
File "/home/sakuragi/Documents/codeplay/google_football_research/football/gfootball/env/football_env_core.py", line 62 in reset
File "/home/sakuragi/Documents/codeplay/google_football_research/football/gfootball/env/football_env_wrapper.py", line 50 in reset
File "/home/sakuragi/Documents/codeplay/google_football_research/football/gfootball/env/football_env.py", line 150 in reset
File "/home/sakuragi/Documents/codeplay/google_football_research/football/gfootball/play_game.py", line 52 in main
File "/home/sakuragi/.local/lib/python3.5/site-packages/absl/app.py", line 251 in _run_main
File "/home/sakuragi/.local/lib/python3.5/site-packages/absl/app.py", line 300 in run
File "/home/sakuragi/Documents/codeplay/google_football_research/football/gfootball/play_game.py", line 64 in
File "/usr/lib/python3.5/runpy.py", line 85 in _run_code
File "/usr/lib/python3.5/runpy.py", line 184 in _run_module_as_main
Segmentation fault (core dumped)
What is going on about this issue?

[Mac OS] Failed building wheel for gfootball

OS: MACOS 10.14
I got process-dependency-links flag at first, then downgraded pip to 18.1 as one of the suggestion, I then got the error failed building wheel for gfootball due to this (probably):
gfootball 0.2 has requirement baseslines>=0.1.6, but you'll have baselines 0.1.5 which is incompatible although I have just installed openai baseline from github.

install.log

c++: internal compiler error: Killed (program cc1plus)

[ 82%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/humangamer.cpp.o
[ 83%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/ball.cpp.o
[ 83%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/match.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
CMakeFiles/menulib.dir/build.make:566: recipe for target 'CMakeFiles/menulib.dir/src/menu/mainmenu.cpp.o' failed
make[2]: *** [CMakeFiles/menulib.dir/src/menu/mainmenu.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
[ 84%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/referee.cpp.o
Scanning dependencies of target blunted2
[ 85%] Building CXX object CMakeFiles/blunted2.dir/src/blunted.cpp.o
/tmp/pip-7rh1cz4t-build/third_party/gfootball_engine/src/onthepitch/match.cpp: In member function 'void Match::RandomizeAdboards(boost::intrusive_ptrblunted::Node)':
/tmp/pip-7rh1cz4t-build/third_party/gfootball_engine/src/onthepitch/match.cpp:512:103: warning: format '%i' expects argument of type 'int', but argument 2 has type 'std::vector<boost::intrusive_ptr<blunted::Resourceblunted::Surface > >::size_type {aka long unsigned int}' [-Wformat=]
if (Verbose()) printf("%i adboards loaded (out of %i files)\n", adboardSurfaces.size(), files.size());
~~~~~~~~~~~~~~~~~~~~~~ ^
/tmp/pip-7rh1cz4t-build/third_party/gfootball_engine/src/onthepitch/match.cpp:512:103: warning: format '%i' expects argument of type 'int', but argument 3 has type 'std::vector<std::__cxx11::basic_string >::size_type {aka long unsigned int}' [-Wformat=]
/tmp/pip-7rh1cz4t-build/third_party/gfootball_engine/src/onthepitch/match.cpp:520:79: warning: format '%i' expects argument of type 'int', but argument 2 has type 'std::__cxx11::list<boost::intrusive_ptrblunted::Geometry >::size_type {aka long unsigned int}' [-Wformat=]
if (Verbose()) printf("number of stadium objects: %i\n", stadiumGeoms.size());
~~~~~~~~~~~~~~~~~~~^
[ 86%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/mentalimage.cpp.o
[ 86%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/AIsupport/AIfunctions.cpp.o
[ 87%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/proceduralpitch.cpp.o
[ 87%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/team.cpp.o
CMakeFiles/Makefile2:377: recipe for target 'CMakeFiles/menulib.dir/all' failed
make[1]: *** [CMakeFiles/menulib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 88%] Building CXX object CMakeFiles/gamelib.dir/src/onthepitch/teamAIcontroller.cpp.o
[ 88%] Linking CXX static library libblunted2.a
[ 88%] Built target blunted2
[ 88%] Linking CXX static library libgamelib.a
[ 88%] Built target gamelib
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
gfootball/build_game_engine.sh: line 19: pushd: third_party/gfootball_engine: No such file or directory
Google Research Football compilation failed

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-7rh1cz4t-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-r6242ms6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-7rh1cz4t-build/
The command '/bin/sh -c cd /gfootball && pip3 install .[tf_$DEVICE] --process-dependency-links' returned a non-zero code: 1

Bug: Rendering frames from dump file with render_dump.py

I have some dump files (with no frame saved) and I am trying to render the frames.

I tried to use the script render_dump.py but I get the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/render_dump.py", line 43, in <module>
    app.run(main)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/render_dump.py", line 40, in main
    processor.write_dump('episode_done')
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/env/observation_processor.py", line 381, in write_dump
    self.process_pending_dumps(True)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/env/observation_processor.py", line 393, in process_pending_dumps
    self._config)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/env/observation_processor.py", line 163, in write_dump
    frame = frame[..., ::-1]
TypeError: string indices must be integers
I0725 16:55:57.314935 140179372074816 observation_processor.py:390] Start dump episode_done
Exception ignored in: <bound method ObservationProcessor.__del__ of <gfootball.env.observation_processor.ObservationProcessor object at 0x7f7dd0174048>>
Traceback (most recent call last):
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/env/observation_processor.py", line 320, in __del__
    self.process_pending_dumps(True)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/env/observation_processor.py", line 393, in process_pending_dumps
    self._config)
  File "/home/alessandroserena/.local/lib/python3.6/site-packages/gfootball/env/observation_processor.py", line 163, in write_dump
    frame = frame[..., ::-1]
TypeError: string indices must be integers

After a closer inspection I have found out that this error occurs because frame is set to the string 'deleted' and the code therefore fails because it is expecting a pixel matrix. This looks like a loop to me since the script that is supposed to generate the frames expects the frames to be there already.

[Arch Linux / Manjaro] Unable to find the requested Boost libraries [boost_signals]

When running pip install .[tf_cpu] --process-dependency-links, I'm getting the following error:

CMake Error at /usr/share/cmake-3.14/Modules/FindBoost.cmake:2165 (message):```

Unable to find the requested Boost libraries.

Boost version: 1.69.0

Boost include path: /usr/include

Could not find the following Boost libraries:

        boost_signals

Some (but not all) of the required Boost libraries were found.  You may
need to install these additional Boost libraries.  Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.

QUESTION: Bots as players and using training output on an agent

Hi, apologies in advance if these qustions are obvious, I'm still learning Python/Linux:

  1. When I run the academy_empty_goal_close with:
    python3 -m gfootball.play_game --level=academy_empty_goal_close --home_players=bot

The outfield player does nothing, then opposing goalkeeper chases and then picks the ball up and throws it out for a corner every episode(?). I would expect, as a bot, the home player to do some kind of action? Is there something I am missing?

2a. When training a policy using the example PPO script where does the policy get saved to?
2b. How do I apply the trained policy to an agent? After training, when I run:
python3 -m gfootball.play_game --level=academy_empty_goal_close --home_players=agent
I get the error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/gfootball/play_game.py", line 64, in <module>
    app.run(main)
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/gfootball/play_game.py", line 55, in main
    _, _, done, _ = env.step(None)
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/gfootball/env/football_env.py", line 139, in step
    observation, reward, done = self._env.step(self._get_actions())
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/gfootball/env/football_env_wrapper.py", line 63, in step
    for a in action
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/gfootball/env/football_env_wrapper.py", line 63, in <listcomp>
    for a in action
  File "/home/cwilliam/linuxenv/lib/python3.6/site-packages/gfootball/env/football_action_set.py", line 231, in action_from_action_set
    assert False, "Action {} not found in action set".format(action)
AssertionError: Action None not found in action set

Many Thanks

@Question - Export exposed observations ?

According to documentation there are some observations like coordinates of players and ball etc.
--dump_full_episodes=True works for dumping data. Is there any flag to export these observations ?

process-dependency-links flag not found

process-dependency-links flag is missing from the new pip release.
(we're currently using it to fetch the newest version of openai baselines code).

If you hit this error - the current workaround is:
replace:

'baselines>=0.1.6',

with
'baselines @ git+git://github.com/openai/baselines.git@master#egg=baselines',

and remove the dependency_links section.

Sorry for the hassle - we're working on the better long term solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.