last_step = 0
with self._summary_writer.as_default():
if self._optimizer.iterations.numpy() == 0:
self._checkpoint.save(0)
self._model.visualize(self._checkpoint.model_dir)
After Change
last_report_time = time.time()
for loss in self._steps(dataset, accum_steps=accum_steps, report_steps=report_steps):
if tf.math.is_nan(loss):
raise RuntimeError("Model diverged with loss = NaN.")
step = iterations.numpy()
if step % report_steps == 0:
_report_training_status(
step,