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

'NamedDict' object has no attribute 'feature_units' #13

Open ai2010 opened 6 years ago

ai2010 commented 6 years ago

I'm trying to run the final zerg bot (zerg_agent_step7.py) through the command:

python3 -m pysc2.bin.agent --map Simple64 --agent zergbot.ZergAgent

and I got the error:

zerglings = self.get_units_by_type(obs, units.Zerg.Zergling) File "/Users/xx/Desktop/xx/xx/pysc2-tutorial/zergbot.py", line 25, in get_units_by_type return [unit for unit in obs.observation.feature_units AttributeError: 'NamedDict' object has no attribute 'feature_units'

dkorduban commented 6 years ago

Just add --use_feature_units parameter to the command.

wartenhx commented 5 years ago

I'm trying to run the final zerg bot (zerg_agent_step7.py) through the command:

python3 -m pysc2.bin.agent --map Simple64 --agent zergbot.ZergAgent

and I got the error:

zerglings = self.get_units_by_type(obs, units.Zerg.Zergling) File "/Users/xx/Desktop/xx/xx/pysc2-tutorial/zergbot.py", line 25, in get_units_by_type return [unit for unit in obs.observation.feature_units AttributeError: 'NamedDict' object has no attribute 'feature_units'

are you fixed it bro? i also stucked in there