chris-chris / pysc2-examples

StarCraft II - pysc2 Deep Reinforcement Learning Examples
Apache License 2.0
753 stars 356 forks source link

Not sure if incompatible with baselines or bad baselines installation #13

Open rwill128 opened 6 years ago

rwill128 commented 6 years ago

I'm getting the following error when I run enjoy_mineral_shards. I didn't exactly have a seamless baselines installation, but I think baselines is installed correctly now and not the problem.

C:\Users\Rick\Desktop\pysc2-examples>python enjoy_mineral_shards.py Traceback (most recent call last): File "enjoy_mineral_shards.py", line 162, in main() File "enjoy_mineral_shards.py", line 55, in main "mineral_shards.pkl", act_params=act_params) File "C:\Users\Rick\Desktop\pysc2-examples\deepq_mineral_shards.py", line 93, in load return ActWrapper.load(path, num_cpu=num_cpu, act_params=act_params) File "C:\Users\Rick\Desktop\pysc2-examples\deepq_mineral_shards.py", line 44, in load act = deepq.build_act(**act_params) File "c:\users\rick\desktop\baselines\baselines\deepq\build_graph.py", line 146, in build_act observations_ph = make_obs_ph("observation") File "enjoy_mineral_shards.py", line 46, in make_obs_ph return U.BatchInput((64, 64), name=name) AttributeError: module 'baselines.common.tf_util' has no attribute 'BatchInput' W0204 12:41:43.175422 10984 sc_process.py:183] Killing the process.

rwill128 commented 6 years ago

It seems like baseline is installed correctly. It's finding the dependency in tf_util, but my version of tf_util has no such method called "BatchInput".

I looked in Git history for baselines, and that file appears to have never had a method called "BatchInput", which is puzzling to me.

I also cannot find a method in tf_util that appears to have analogous functionality. Any clues as to why this code is calling tf_util.BatchInput when that method doesn't exist?

brean commented 6 years ago

BatchInput was part of baselines/common/tf_util.py since its last cleanup-commit (take a look at this change). I guess it moved to baselines/deepq/utils.py (see here)

Using load_state and BatchInput from baselines.deepq.utils seems to work fine.

rwill128 commented 6 years ago

Thanks!

moshebeutel commented 6 years ago

hi maybe this is related...

while trying to run train_mineal_shards.py I got

Traceback (most recent call last): File "/home/iaiai/pysc2-examples/train_mineral_shards.py", line 14, in from a2c.policies import CnnPolicy File "/home/iaiai/pysc2-examples/a2c/policies.py", line 3, in from baselines.acktr.utils import conv, fc, dense, conv_to_fc, sample, kl_div ImportError: cannot import name 'conv'