inoryy / reaver

Reaver: Modular Deep Reinforcement Learning Framework. Focused on StarCraft II. Supports Gym, Atari, and MuJoCo.
MIT License
554 stars 89 forks source link

code error when running the test code #27

Open simayuhe opened 5 years ago

simayuhe commented 5 years ago

import reaver as rvr env = rvr.envs.SC2Env(map_name='MoveToBeacon') agent = rvr.agents.A2C(env.obs_spec(), env.act_spec(), rvr.models.build_fully_conv,rvr.models.SC2MultiPolicy, n_envs=1) agent.run(env)

1st error :..pysc2/lib/features.py:737: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.

2ed error: .../pysc2/lib/named_array.py", line 208, in _get_index "Can't index by type: %s; only int, string or slice" % type(index))

inoryy commented 5 years ago

which PySC2 version do you have?

simayuhe commented 5 years ago

PySC2 version is 2.0.2. and the examples at https://github.com/deepmind/pysc2 can be run correctly.

inoryy commented 5 years ago

I can confirm the first one, though it's actually a FutureWarning, not an error (e.g. doesn't prevent the code from running). Unfortunately, it's happening inside PySC2, so I can't really do much about it.

While not a good idea in general, but as a temporary workaround, you can suppress these warnings inside your code, like so:

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

I'm unable to replicate the second error, even in a clean environment install. For reference, here is packages dump from the env:

# Name                    Version
python                    3.6.7
gin-config                0.1.2
numpy                     1.16.2
PySC2                     2.0.2
reaver                    2.1.8
s2clientprotocol          4.8.3.72282.0
tensorflow                1.12.0 
tensorflow-probability    0.5.0
EvanWilliams commented 4 years ago

I just found this happening to me when incorrectly using Pysc2 2.0.1. This post helped me debug. and finally get this running after switching from mac to PC. Thanks for the amazing tool @inoryy . Truly incredible

inoryy commented 4 years ago

@EvanWilliams thank you for the kind words! I'm happy to hear you've found reaver useful :)