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

KeyError: 'NO-OP' in the first example. #4

Closed
miguelgondu opened this issue Oct 25, 2019 · 3 comments
Closed

KeyError: 'NO-OP' in the first example. #4

miguelgondu opened this issue Oct 25, 2019 · 3 comments

Comments

@miguelgondu
Copy link

Hi,

After installing py-vgdl by cloning your repo and running pip install -e '.[all]', I tried to run the first example python -m vgdl.util.humanplay.play_vgdl vgdl/games/aliens_lvl0.txt but got a KeyError: 'NO-OP'.

Thanks.

@atreyasha
Copy link

Similar problem here.

When I use the latest gym==0.15.3, I get:

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/.local/lib/python3.7/site-packages/vgdl/util/humanplay/play_vgdl.py", line 102, in <module>
    main()
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/play_vgdl.py", line 78, in main
    args.blocksize)
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/play_vgdl.py", line 33, in register_vgdl_env
    nondeterministic=True
  File "/home/shankar/.local/lib/python3.7/site-packages/gym/envs/registration.py", line 153, in register
    return registry.register(id, **kwargs)
  File "/home/shankar/.local/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'

If I downgrade to gym==0.12.1, the timestep_limit error disappears and I receive a similar error as the OP:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
/home/shankar/.local/lib/python3.7/site-packages/gym/envs/registration.py:64: UserWarning: register(timestep_limit=10000) is deprecated. Use register(max_episode_steps=10000) instead.
  warnings.warn("register(timestep_limit={}) is deprecated. Use register(max_episode_steps={}) instead.".format(timestep_limit, timestep_limit))
WARNING:vgdl.util.humanplay.human trace_path provided but could not find the gym_recording package
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 1025, in emit
    msg = self.format(record)
  File "/usr/lib/python3.7/logging/__init__.py", line 869, in format
    return fmt.format(record)
  File "/usr/lib/python3.7/logging/__init__.py", line 608, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  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/.local/lib/python3.7/site-packages/vgdl/util/humanplay/play_vgdl.py", line 102, in <module>
    main()
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/play_vgdl.py", line 93, in main
    window_open = controller.play(args.pause_on_finish)
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/human.py", line 41, in play
    obs, reward, done, info = self.env.step(self.controls.current_action)
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/controls.py", line 84, in current_action
    logger.debug('Combo not recognized:', active_keys)
Message: 'Combo not recognized:'
Arguments: ([],)
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/.local/lib/python3.7/site-packages/vgdl/util/humanplay/play_vgdl.py", line 102, in <module>
    main()
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/play_vgdl.py", line 93, in main
    window_open = controller.play(args.pause_on_finish)
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/human.py", line 41, in play
    obs, reward, done, info = self.env.step(self.controls.current_action)
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/controls.py", line 85, in current_action
    return self.perform_noop()
  File "/home/shankar/.local/lib/python3.7/site-packages/vgdl/util/humanplay/controls.py", line 202, in perform_noop
    return self.available_actions['NO_OP']
KeyError: 'NO_OP'

@rubenvereecken
Copy link
Owner

rubenvereecken commented Oct 29, 2019

@miguelgondu Interesting I can't reproduce that. Could you try and check out the latest version. If it persists, could you show me a whole stack trace?

@miguelgondu
Copy link
Author

I get the same stack trace than @atreyasha when on gym==0.15.3:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
WARNING:vgdl.util.humanplay.human trace_path provided but could not find the gym_recording package
--- Logging error ---
Traceback (most recent call last):
  File "//anaconda3/envs/pyvgdl/lib/python3.6/logging/__init__.py", line 994, in emit
    msg = self.format(record)
  File "//anaconda3/envs/pyvgdl/lib/python3.6/logging/__init__.py", line 840, in format
    return fmt.format(record)
  File "//anaconda3/envs/pyvgdl/lib/python3.6/logging/__init__.py", line 577, in format
    record.message = record.getMessage()
  File "//anaconda3/envs/pyvgdl/lib/python3.6/logging/__init__.py", line 338, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "//anaconda3/envs/pyvgdl/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "//anaconda3/envs/pyvgdl/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/play_vgdl.py", line 101, in <module>
    main()
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/play_vgdl.py", line 92, in main
    window_open = controller.play(args.pause_on_finish)
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/human.py", line 41, in play
    obs, reward, done, info = self.env.step(self.controls.current_action)
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/controls.py", line 84, in current_action
    logger.debug('Combo not recognized:', active_keys)
Message: 'Combo not recognized:'
Arguments: ([],)
Traceback (most recent call last):
  File "//anaconda3/envs/pyvgdl/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "//anaconda3/envs/pyvgdl/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/play_vgdl.py", line 101, in <module>
    main()
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/play_vgdl.py", line 92, in main
    window_open = controller.play(args.pause_on_finish)
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/human.py", line 41, in play
    obs, reward, done, info = self.env.step(self.controls.current_action)
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/controls.py", line 85, in current_action
    return self.perform_noop()
  File "/Users/migd/Projects/py-vgdl/vgdl/util/humanplay/controls.py", line 202, in perform_noop
    return self.available_actions['NO_OP']

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

No branches or pull requests

3 participants