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

import reaver results in error #24

Closed howardfk closed 5 years ago

howardfk commented 5 years ago

First, Following the install instructions to use source for both reaver and pysc2.

The error has changed. I realized I did not have TF-probability installed. However I'm still receiving an error.

When running import reaver i receive the fallowing error

Traceback (most recent call last): File "", line 1, in File "/home/hf/.local/lib/python3.6/site-packages/reaver/init.py", line 1, in import reaver.envs File "/home/hf/.local/lib/python3.6/site-packages/reaver/envs/init.py", line 6, in from .gym import GymEnv File "/home/hf/.local/lib/python3.6/site-packages/reaver/envs/gym.py", line 3, in from reaver.envs.atari import AtariPreprocessing File "/home/hf/.local/lib/python3.6/site-packages/reaver/envs/atari.py", line 29, in import gin.tf File "/home/hf/.local/lib/python3.6/site-packages/gin/tf/init.py", line 20, in from gin.tf.utils import GinConfigSaverHook File "/home/hf/.local/lib/python3.6/site-packages/gin/tf/utils.py", line 34, in config.register_file_reader(tf.io.gfile.GFile, tf.io.gfile.exists) AttributeError: module 'tensorflow._api.v1.io' has no attribute 'gfile'

=====\==============//====================

OLD ERROR: When running import reaver i receive the fallowing error

  File "<stdin>", line 1, in <module>
  File "/home/hf/.local/lib/python3.6/site-packages/reaver/__init__.py", line 1, in <module>
    import reaver.envs
  File "/home/hf/.local/lib/python3.6/site-packages/reaver/envs/__init__.py", line 2, in <module>
    from .sc2 import SC2Env
  File "/home/hf/.local/lib/python3.6/site-packages/reaver/envs/sc2.py", line 5, in <module>
    from pysc2.lib import actions
ModuleNotFoundError: No module named 'pysc2.lib'

However I have no problems with 'import pysc2'

inoryy commented 5 years ago

Which version of TensorFlow do you have?

howardfk commented 5 years ago

tensorflow-gpu 1.12.0

additional side note: I tried my best to eliminate user error. I think I set up pysc2 from source. on the github repo the most recent pyc2 is version 2.0.1, however on reavers requirements it says PySC2 > 2.0.1

Should i be expecting pysc2 >= 2.0.2?

(also thanks for replying so quickly)

inoryy commented 5 years ago

I don't think PySC2 is the culprit, but just to be safe try running:

pip install --upgrade https://github.com/deepmind/pysc2/archive/master.zip

The 2.0.1 version is what you get from pip, but you would also see it from source since that's what their setup.py currently says. By specifying > 2.0.1, I ensure the correct version will be installed in the future.


Can you also report what versions of gin, and tf-probability you have installed?

howardfk commented 5 years ago

After reinstalling with your pip line, i get the same error.

tensorflow-probability 0.5.0 gin-config 0.1.3

All i have is gin-config is this the same as gin?

inoryy commented 5 years ago

Yes, sorry, gin-config is correct. Can you try downgrading it to 0.1.2?

pip install gin-config==0.1.2
inoryy commented 5 years ago

Should be fixed now, the culprit was indeed gin-config, thanks for reporting the issue!
You can get the correct version either with above command or with pip install --upgrade reaver.

howardfk commented 5 years ago

Backing up to gin-conifg==0.1.2 has fixed this issue, It then created a strange issue where python could not see the package. So i installed gin-config==0.1.2 from source and that created an issue where i need to back up to TF==1.11.0, which then needed me to back up to TF-probability==0.4.0

But now it works!!!!!

Big thank you for all the help!