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

watching game visualization during training #22

Closed
rbunn80110 opened this issue Feb 23, 2018 · 3 comments
Closed

watching game visualization during training #22

rbunn80110 opened this issue Feb 23, 2018 · 3 comments

Comments

@rbunn80110
Copy link

rbunn80110 commented Feb 23, 2018

I looked through all the arguments and I don't see one that allows you to watch the game being played while training. I guess I must be missing something really obvious. Great work by the way!

@rbunn80110
Copy link
Author

I think I figured it out, but let me know if I did it wrong somehow.

put this as an arg in main.py:


parser.add_argument(
    '--render',
    default=True,
    metavar='R',
    help='Watch game as it being played')

Then add this under the while True loop in train and test.py:

        if args.render:
            player.env.render()

@rbunn80110
Copy link
Author

After playing around with it, it appears that it works better when the code is added to test but not train.

@dgriff777
Copy link
Owner

Yup just like it in the gym_eval.py script that works. Yes if you want while while training just put in this the test not the train. That should be preferable too as too watch the train workers would slow down too much. If you really want to see a training agent just put the same code in train and get rid of test render and also make sure to specify only one worker to render. The environment can't handle multiprocessing and rendering game. Its a gym environment issue

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

2 participants