From ac1bddc1eca0c64f950d65ae4154a1904255f206 Mon Sep 17 00:00:00 2001 From: sp Date: Sat, 30 Dec 2023 13:08:45 +0100 Subject: [PATCH] flush after writing text --- examples/shields/rl/callbacks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/shields/rl/callbacks.py b/examples/shields/rl/callbacks.py index 4270d15..4d304e9 100644 --- a/examples/shields/rl/callbacks.py +++ b/examples/shields/rl/callbacks.py @@ -31,11 +31,13 @@ class MyCallbacks(DefaultCallbacks): file_writer = tf.summary.create_file_writer(algorithm.logdir) with file_writer.as_default(): tf.summary.text("first_text", "testing", step=0) + file_writer.flush() def on_episode_start(self, *, worker: RolloutWorker, base_env: BaseEnv, policies: Dict[PolicyID, Policy], episode, env_index, **kwargs) -> None: file_writer = tf.summary.create_file_writer(worker.io_context.log_dir) with file_writer.as_default(): tf.summary.text("first_text_from_episode_start", "testing_in_episode", step=0) + file_writer.flush() # print(F"Epsiode started Environment: {base_env.get_sub_environments()}") env = base_env.get_sub_environments()[0] episode.user_data["count"] = 0