Ejemplo n.º 1
0
def test(best=False):
    with tf.Session() as sess:
        agent = Agent(sess)
        agent.sess = sess
        SAVER.set_sess(sess)
        SAVER.load(agent, best)
        agent.env.set_render(True)
        agent.play(3)
Ejemplo n.º 2
0
from Agent import Agent

from Displayer import DISPLAYER
from Saver import SAVER

import parameters

if __name__ == '__main__':

    tf.reset_default_graph()

    with tf.Session() as sess:

        agent = Agent(sess)
        SAVER.set_sess(sess)

        SAVER.load(agent)

        print("Beginning of the run")
        try:
            agent.run()
        except KeyboardInterrupt:
            pass
        print("End of the run")
        SAVER.save(agent.total_steps)
        DISPLAYER.disp()

        # agent.play(10)

        # agent.play(3, "results/gif/".format(parameters.ENV))