skjb / pysc2-tutorial

Tutorials for building a PySC2 bot
https://medium.com/@skjb/building-a-basic-pysc2-agent-b109cde1477c
MIT License
287 stars 85 forks source link

error trying to run agent #8

Closed craigham closed 6 years ago

craigham commented 6 years ago

Running this on Mac. I get this error. Any ideas? thanks

I1216 13:36:12.326220 4320764736 sc2_env.py:200] Environment is ready. I1216 13:36:12.352599 4320764736 sc2_env.py:240] Starting episode: 1 0/no_op () 1/move_camera (1/minimap [64, 64]) 2/select_point (6/select_point_act [4]; 0/screen [84, 84]) 3/select_rect (7/select_add [2]; 0/screen [84, 84]; 2/screen2 [84, 84]) 4/select_control_group (4/control_group_act [5]; 5/control_group_id [10]) 264/Harvest_Gather_screen (3/queued [2]; 0/screen [84, 84]) 12/Attack_screen (3/queued [2]; 0/screen [84, 84]) 13/Attack_minimap (3/queued [2]; 1/minimap [64, 64]) 274/HoldPosition_quick (3/queued [2]) 451/Smart_screen (3/queued [2]; 0/screen [84, 84]) 452/Smart_minimap (3/queued [2]; 1/minimap [64, 64]) 453/Stop_quick (3/queued [2]) 331/Move_screen (3/queued [2]; 0/screen [84, 84]) 332/Move_minimap (3/queued [2]; 1/minimap [64, 64]) 333/Patrol_screen (3/queued [2]; 0/screen [84, 84]) 334/Patrol_minimap (3/queued [2]; 1/minimap [64, 64]) 79/Build_Refinery_screen (3/queued [2]; 0/screen [84, 84]) 91/Build_SupplyDepot_screen (3/queued [2]; 0/screen [84, 84]) 220/Effect_Repair_screen (3/queued [2]; 0/screen [84, 84]) 221/Effect_Repair_autocast () 230/Effect_Spray_screen (3/queued [2]; 0/screen [84, 84]) 269/Harvest_Return_quick (3/queued [2]) 50/Build_EngineeringBay_screen (3/queued [2]; 0/screen [84, 84]) Took 1.550 seconds for 34 steps: 21.942 fps I1216 13:36:13.902295 4320764736 sc2_env.py:327] Environment Close I1216 13:36:13.902536 4320764736 sc2_env.py:342] Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/bin/agent.py", line 112, in <module> app.run(main) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/absl/app.py", line 274, in run _run_main(main, argv) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/absl/app.py", line 238, in _run_main sys.exit(main(argv)) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/bin/agent.py", line 98, in main run_thread(agent_cls, FLAGS.map, FLAGS.render) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/bin/agent.py", line 77, in run_thread run_loop.run_loop([agent], env, FLAGS.max_agent_steps) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/env/run_loop.py", line 46, in run_loop timesteps = env.step(actions) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/env/available_actions_printer.py", line 32, in step all_obs = super(AvailableActionsPrinter, self).step(*args, **kwargs) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/env/base_env_wrapper.py", line 42, in step return self._env.step(*args, **kwargs) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/lib/stopwatch.py", line 197, in _stopwatch return func(*args, **kwargs) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/env/sc2_env.py", line 254, in step for c, o, a in zip(self._controllers, self._obs, actions)) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/lib/run_parallel.py", line 54, in run funcs = [f if callable(f) else functools.partial(*f) for f in funcs] File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/lib/run_parallel.py", line 54, in <listcomp> funcs = [f if callable(f) else functools.partial(*f) for f in funcs] File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/env/sc2_env.py", line 254, in <genexpr> for c, o, a in zip(self._controllers, self._obs, actions)) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/lib/stopwatch.py", line 197, in _stopwatch return func(*args, **kwargs) File "/Users/craigh/python/virtual-env3/sc2ai-2/lib/python3.6/site-packages/pysc2/lib/features.py", line 427, in transform_action func, func_call.arguments)) ValueError: Argument is out of range for 91/Build_SupplyDepot_screen (3/queued [2]; 0/screen [0, 0]), got: [[0], [48, 98]] I1216 13:36:13.946142 4320764736 sc2_env.py:327] Environment Close I1216 13:36:13.946537 4320764736 sc2_env.py:342] I1216 13:36:13.946666 4320764736 sc2_env.py:327] Environment Close I1216 13:36:13.946901 4320764736 sc2_env.py:342] W1216 13:36:17.142264 4320764736 sc_process.py:183] Killing the process. I1216 13:36:17.427438 4320764736 sc_process.py:166] Shutdown with return code: -9

craigham commented 6 years ago

I may have just resized the game screen or something. I have the smart agent working now. please ignore.