Skip to content

Commit

Permalink
logger artifact working for both wandb and mlflow
Browse files Browse the repository at this point in the history
  • Loading branch information
khintz committed Oct 7, 2024
1 parent 7eed79b commit 27408f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions neural_lam/models/ar_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,13 @@ def aggregate_and_plot_metrics(self, metrics_dict, prefix):
)

if self.trainer.is_global_zero and not self.trainer.sanity_checking:

current_epoch = self.trainer.current_epoch

for key, figure in log_dict.items():
if not isinstance(self.logger, pl.loggers.WandbLogger):
key = f"{key}-{current_epoch}"

self.logger.log_image(key=key, images=[figure])

plt.close("all") # Close all figs
Expand Down

0 comments on commit 27408f2

Please sign in to comment.