Fixed bug tto check if log_writer is not None before calling log_model
@@ -380,6 +380,7 @@ def train(config,
epoch=epoch,
global_step=global_step)
+ if log_writer is not None:
log_writer.log_model(is_best=False, prefix="latest")
if dist.get_rank() == 0 and epoch > 0 and epoch % save_epoch_step == 0:
@@ -394,7 +395,7 @@ def train(config,
best_model_dict=best_model_dict,
epoch=epoch,
global_step=global_step)
-
+ if log_writer is not None:
log_writer.log_model(is_best=False, prefix='iter_epoch_{}'.format(epoch))
best_str = 'best metric, {}'.format(', '.join(
