From 6924abdd3ea3e0679c562e739fbbd3c690ee2556 Mon Sep 17 00:00:00 2001 From: NM512 Date: Wed, 26 Jul 2023 01:00:03 +0900 Subject: [PATCH] eval is executed after steps in config elapsed --- dreamer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dreamer.py b/dreamer.py index 5c8a17c..252194d 100644 --- a/dreamer.py +++ b/dreamer.py @@ -323,7 +323,8 @@ def main(config): agent.load_state_dict(torch.load(logdir / "latest_model.pt")) agent._should_pretrain._once = False - while agent._step < config.steps: + # make sure eval will be executed once after config.steps + while agent._step < config.steps + config.eval_every: logger.write() print("Start evaluation.") eval_policy = functools.partial(agent, training=False)