I got error
player_y, player_x = (obs.observation["minimap"][_PLAYER_RELATIVE] == _PLAYER_SELF).nonzero()
KeyError: 'minimap'
Why does it happen and how can I fix it...?
Looks like there may be some breaking changes from a newer release of pysc2? In the "Refining the Sparse Reward Agent": From the command line I got an error that "T" is not a valid race type. Changing that to "terran" allowed the simulation to launch, but it soon crashed with a "key not found" error:
File "skjb\pysc2-tutorial\Refining the Sparse Reward Agent\refined_agent.py", line 173, in step unit_type = obs.observation['screen'][_UNIT_TYPE] KeyError: 'screen'
Very late solution post, but will be useful for other people hopefully,
IF YOU ARE USING pysc2 version 3.0.0
-
Instead of obs.observation['screen'][_UNIT_TYPE] use
obs.observation["feature_screen"][_UNIT_TYPE] -
Instead of obs.observation["minimap"][_PLAYER_RELATIVE] use obs.observation["feature_screen"][_PLAYER_RELATIVE]