From 2f84459d26f9bbbf116a4a9548b309cacfcc510a Mon Sep 17 00:00:00 2001 From: ananthsub Date: Wed, 21 Apr 2021 10:20:27 -0700 Subject: [PATCH] Broadcast dirpath for tighter consistency in model checkpoint callback (#6978) * Update model_checkpoint.py * Update model_checkpoint.py * Update model_checkpoint.py --- pytorch_lightning/callbacks/model_checkpoint.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py index a1a44fd70b..29b6d8681d 100644 --- a/pytorch_lightning/callbacks/model_checkpoint.py +++ b/pytorch_lightning/callbacks/model_checkpoint.py @@ -552,13 +552,12 @@ class ModelCheckpoint(Callback): trainer.logger.version if isinstance(trainer.logger.version, str) else f"version_{trainer.logger.version}" ) - - version, name = trainer.training_type_plugin.broadcast((version, trainer.logger.name)) - - ckpt_path = os.path.join(save_dir, str(name), version, "checkpoints") + ckpt_path = os.path.join(save_dir, str(trainer.logger.name), version, "checkpoints") else: ckpt_path = os.path.join(trainer.weights_save_path, "checkpoints") + ckpt_path = trainer.training_type_plugin.broadcast(ckpt_path) + self.dirpath = ckpt_path if not trainer.fast_dev_run and trainer.is_global_zero: