symbolic-rl icon indicating copy to clipboard operation
symbolic-rl copied to clipboard

Issue related to gym/py-vgdl compatibility

Open atreyasha opened this issue 5 years ago • 2 comments

Hello, thank you for your work and code. I am a student in the University of Potsdam (working with clingo) and we are trying to incorporate your methods into our research in RL.

Just want to give you a heads up to a compatibility issue #4 with py-vgdl.

At the moment, this issue is preventing us from being able to run your scripts. Would you recommend any temporary workaround that we could use in the meantime? I checked your requirements.txt for the gym version you were using but we were unable to find one.

atreyasha avatar Oct 27 '19 22:10 atreyasha

Hi, thank you for reaching out to me. I have just updated the requirements.txt.

Could you please try again if it works for you (sorry the code is not very clean/readable I think)? Let me know if you have any questions regarding the my research etc.

921kiyo avatar Oct 27 '19 23:10 921kiyo

Hi again, thank you for your quick response. So I just initialized a pip virtual environment and installed all of the dependencies in requirements.txt.

When I run the simple.py script, I arrive at the following error:

Traceback (most recent call last):
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/lib/python3.7/site-packages/gym/envs/registration.py", line 132, in spec
    return self.env_specs[id]
KeyError: 'vgdl_experiment4_before-v0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "simple.py", line 18, in <module>
    env = gym.make('vgdl_experiment4_before-v0')
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/lib/python3.7/site-packages/gym/envs/registration.py", line 156, in make
    return registry.make(id, **kwargs)
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/lib/python3.7/site-packages/gym/envs/registration.py", line 100, in make
    spec = self.spec(path)
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/lib/python3.7/site-packages/gym/envs/registration.py", line 142, in spec
    raise error.UnregisteredEnv('No registered env with id: {}'.format(id))
gym.error.UnregisteredEnv: No registered env with id: vgdl_experiment4_before-v0

Based on my knowledge with gym, registering an environment can be slightly complicated and I guess this is where py-vgdl comes in. Would you know how to do this registration via py-vgdl?

On another note, when I run a unit test on py-vgdl to test for human-interactable games, I arrive at the following error which is similar as per issue #4 in the py-vgdl repository:

$ python3 -m vgdl.util.humanplay.play_vgdl ./py-vgdl/vgdl/games/aliens_lvl0.txt

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/src/vgdl/vgdl/util/humanplay/play_vgdl.py", line 102, in <module>
    main()
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/src/vgdl/vgdl/util/humanplay/play_vgdl.py", line 78, in main
    args.blocksize)
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/src/vgdl/vgdl/util/humanplay/play_vgdl.py", line 33, in register_vgdl_env
    nondeterministic=True
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/lib/python3.7/site-packages/gym/envs/registration.py", line 153, in register
    return registry.register(id, **kwargs)
  File "/home/shankar/Desktop/Git/symbolic-rl/ilp/lib/python3.7/site-packages/gym/envs/registration.py", line 147, in register
    self.env_specs[id] = EnvSpec(id, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'timestep_limit'

atreyasha avatar Oct 28 '19 06:10 atreyasha