From b5c6a63ed9dee5ac39b0ed8732f9a0e0a0f21c41 Mon Sep 17 00:00:00 2001 From: Jeevesh Juneja Date: Tue, 19 Apr 2022 20:57:54 +0530 Subject: [PATCH] Correct Logging of Eval metric to Tensorboard (#16825) * Correct Logging of Eval metric to Tensorboard An empty dictionary ``eval_metrics`` was being logged, is replaced by ``eval_metric`` which is the output dictionary of ``metric.compute()``. * Remove unused variable --- examples/flax/text-classification/run_flax_glue.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/flax/text-classification/run_flax_glue.py b/examples/flax/text-classification/run_flax_glue.py index 3ff6134531..23144069d7 100755 --- a/examples/flax/text-classification/run_flax_glue.py +++ b/examples/flax/text-classification/run_flax_glue.py @@ -592,7 +592,6 @@ def main(): if (cur_step % training_args.eval_steps == 0 or cur_step % steps_per_epoch == 0) and cur_step > 0: - eval_metrics = {} # evaluate eval_loader = glue_eval_data_collator(eval_dataset, eval_batch_size) for batch in tqdm( @@ -623,7 +622,7 @@ def main(): logger.info(f"Step... ({cur_step}/{total_steps} | Eval metrics: {eval_metric})") if has_tensorboard and jax.process_index() == 0: - write_eval_metric(summary_writer, eval_metrics, cur_step) + write_eval_metric(summary_writer, eval_metric, cur_step) if (cur_step % training_args.save_steps == 0 and cur_step > 0) or (cur_step == total_steps): # save checkpoint after each epoch and push checkpoint to the hub