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

examples/agents/keyboard_agent.py fails with "AttributeError: 'TimeLimit' object has no attribute 'viewer'" #483

Closed
cirosantilli opened this Issue Feb 1, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@cirosantilli

cirosantilli commented Feb 1, 2017

[2017-02-01 21:58:16,739] Making new env: LunarLander-v2
Traceback (most recent call last):
  File "examples/agents/keyboard_agent.py", line 37, in <module>
    env.viewer.window.on_key_press = key_press
AttributeError: 'TimeLimit' object has no attribute 'viewer'

Ubuntu 16.10.

Maybe also make tabular_q_agent.py runnable, currently just class def.

d337f4e

@olegklimov

This comment has been minimized.

Contributor

olegklimov commented Feb 1, 2017

To fix this, keyboard_agent.py needs an option to create environments without any wrappers.

Another option would be to kill keyboard_agent.py. Is it useful or not?

Pro:

  • Helpful for people to be less afraid of viewer, understand it's just a pyglet window.
  • Helpful to have control over execution of the program. I never use manual control, but pause, manual restart, visualization options.

Cons:

  • Manual control really works only for Lander.
  • It is a hack.
@nottombrown

This comment has been minimized.

Contributor

nottombrown commented Feb 1, 2017

Fixed in 2d41d69, thanks for the report!

@nottombrown nottombrown closed this Feb 1, 2017

@cirosantilli

This comment has been minimized.

cirosantilli commented Feb 18, 2017

Thanks for the fix, but it is impossible to control without frame rate limiting :-)

I wish there was a generalized script to use any (discrete action) agent with the keyboard :-)

@olegklimov

This comment has been minimized.

Contributor

olegklimov commented Feb 19, 2017

@cirosantilli render('human') many times.

@cirosantilli

This comment has been minimized.

cirosantilli commented Feb 19, 2017

@olegklimov ah it's fine, I don't need to hand control it that badly 😄

If you ever decide to seriously implement some rate limiting, consider this for inspiration: https://github.com/cirosantilli/general-game-ai/blob/310136f0c1a2108e75f21c51fdf6de8190ff4a1a/main.cpp#L245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment