google-deepmind / pysc2

StarCraft II Learning Environment
Apache License 2.0
8k stars 1.15k forks source link

Multi-agent games cause RunParallel to time out part way through game #319

Open danielclymer opened 3 years ago

danielclymer commented 3 years ago

I have no problem running games between an agent and a bot. However, if I try to have two agents play against each other using the run_loop function, it will start the game, but at some point get stuck during the env.step() phase and timeout without finishing.

It appears that it is stuck waiting for one of the agent.step actions to complete and it never completes. I was wondering if anyone has had this issue with multiagent training? My error is:

I1013 05:07:09.014481 140473005135680 sc2_env.py:759] Environment Close Error terminating: trying to process a request this response pending: 12. Fatal error encountered! Backtrace: DataHandler: unable to parse websocket frame. CloseHandler: 127.0.0.1:34372 disconnected DataHandler: unable to parse websocket frame. Error terminating: trying to process a request this response pending: 12. CloseHandler: 127.0.0.1:34268 disconnected Fatal error encountered! Backtrace: /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x65e838] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x65f270] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x65ecc2] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x105f7ae] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x103505d] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x1b8fb47] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x1b9349c] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x5f8825] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f8d5b667b97] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x5f7f59] Error condition code: '9' Error suffix: 'Error' Error preface: 'A fatal error occurred:' Error failure: 'e_success' Error details: '"AppErrors.txt"' Error description: 'AppErrors.txt' Error signal: '11' Backtrace: /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x65e743] /lib/x86_64-linux-gnu/libc.so.6(+0x3efd0)[0x7f8d5b684fd0] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x6aab63] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x264debd] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x23dc444] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x23de3b3] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x23defec] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x23ded53] /lib/x86_64-linux-gnu/libc.so.6(+0x430f1)[0x7f8d5b6890f1] /lib/x86_64-linux-gnu/libc.so.6(+0x431ea)[0x7f8d5b6891ea] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x6855ce] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x65f27a] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x65ecc2] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x105f7ae] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x103505d] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x1b8fb47] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x1b9349c] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x5f8825] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f8d5b667b97] /home/dclymer/StarCraftII/Versions/Base75689/SC2_x64[0x5f7f59] I1013 05:07:09.116823 140473005135680 sc_process.py:232] Shutdown gracefully. I1013 05:07:09.116958 140473005135680 sc_process.py:210] Shutdown with return code: -15 I1013 05:07:09.218626 140473005135680 sc_process.py:232] Shutdown gracefully. I1013 05:07:09.218785 140473005135680 sc_process.py:210] Shutdown with return code: -11 Traceback (most recent call last): File "/home/dclymer/Work/Gamebreaker/Workspace/play_game_and_get_actions.py", line 324, in app.run(main) File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "/home/dclymer/Work/Gamebreaker/Workspace/play_game_and_get_actions.py", line 286, in main timesteps = env.step(step_actions) File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/pysc2/lib/stopwatch.py", line 212, in _stopwatch return func(*args, **kwargs) File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/pysc2/env/sc2_env.py", line 550, in step return self._step(step_mul) File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/pysc2/env/sc2_env.py", line 568, in _step current_game_loop=current_game_loop) File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/pysc2/env/sc2_env.py", line 633, in _step_to self._parallel.run((c.step, step_mul) for c in self._controllers) File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/pysc2/lib/run_parallel.py", line 80, in run return [f.result(timeout=0) for f in futs] File "/home/dclymer/Work/Gamebreaker/Workspace/sc2venv/lib/python3.6/site-packages/pysc2/lib/run_parallel.py", line 80, in return [f.result(timeout=0) for f in futs] File "/usr/lib/python3.6/concurrent/futures/_base.py", line 434, in result raise TimeoutError() concurrent.futures._base.TimeoutError I1013 05:07:09.295356 140473005135680 sc2_env.py:759] Environment Close

Tonix22 commented 3 years ago

Same issue here, did you solved it?