diff --git a/main.py b/main.py index 5214a52f8a7b88144febb528c280935b08fc8e66..a362e28a6b33d2b9878231a6a98505a8bdde130a 100644 --- a/main.py +++ b/main.py @@ -22,8 +22,7 @@ def run(conf): # Register an *atexit* callback, # to store the corrent result of the agent # if the program is interrupted. - if conf.learn: - atexit.register(marvin.save, conf.save_to) + atexit.register(marvin.save, conf.save_to) # Offline training of the agent with # previous collected and saved memories. @@ -38,8 +37,7 @@ def run(conf): loss, avg_score = ew.run(conf.env, marvin, conf.run_episodes, render=conf.render, learn=_LEARN, conf=conf) # Save the final training result of the agent. - if conf.learn: - marvin.save(conf.save_to) + marvin.save(conf.save_to) ew.process_logs(avg_score, loss, conf)