Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code error when running the test code #27

Open
simayuhe opened this issue Mar 4, 2019 · 5 comments
Open

code error when running the test code #27

simayuhe opened this issue Mar 4, 2019 · 5 comments
Labels

Comments

@simayuhe
Copy link

simayuhe commented Mar 4, 2019

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
Copy link
Owner

inoryy commented Mar 4, 2019

which PySC2 version do you have?

@simayuhe
Copy link
Author

simayuhe commented Mar 6, 2019

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

@inoryy
Copy link
Owner

inoryy commented Mar 7, 2019

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

@inoryy inoryy added the bug label Jul 6, 2019
@EvanWilliams
Copy link

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
Copy link
Owner

inoryy commented Dec 12, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants