Skip to content

Commit

Permalink
Fix accidental removal of printing of loss
Browse files Browse the repository at this point in the history
 and pseudo dice.
  • Loading branch information
TaWald committed Oct 11, 2023
1 parent cfb67c5 commit c7ae896
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,10 @@ def on_epoch_end(self):
# todo find a solution for this stupid shit
self.print_to_log_file(
f"Epoch time: {np.round(self.logger.my_fantastic_logging['epoch_end_timestamps'][-1] - self.logger.my_fantastic_logging['epoch_start_timestamps'][-1], decimals=2)} s")

self.print_to_log_file('train_loss', np.round(self.logger.my_fantastic_logging['train_losses'][-1], decimals=4))
self.print_to_log_file('val_loss', np.round(self.logger.my_fantastic_logging['val_losses'][-1], decimals=4))
self.print_to_log_file('Pseudo dice', [np.round(i, decimals=4) for i in
self.logger.my_fantastic_logging['dice_per_class_or_region'][-1]])
# handling periodic checkpointing
current_epoch = self.current_epoch
if (current_epoch + 1) % self.save_every == 0 and current_epoch != (self.num_epochs - 1):
Expand Down

0 comments on commit c7ae896

Please sign in to comment.