Write evaluation metrics to TF summary.
(summary_writer, global_step, eval_metrics)
| 449 | |
| 450 | |
| 451 | def write_summary(summary_writer, global_step, eval_metrics): |
| 452 | """Write evaluation metrics to TF summary.""" |
| 453 | numeric_dict = {} |
| 454 | for name, value in eval_metrics.items(): |
| 455 | numeric_dict[name] = float(orbit.utils.get_value(value)) |
| 456 | with summary_writer.as_default(): |
| 457 | for name, value in numeric_dict.items(): |
| 458 | tf.summary.scalar(name, value, step=global_step) |
| 459 | summary_writer.flush() |
| 460 | |
| 461 | |
| 462 | def remove_ckpts(model_dir): |