Skip to content

Commit 0f6a6a3

Browse files
committed
fix 479
1 parent 8e1d23b commit 0f6a6a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

terratorch/cli_tools.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,9 @@ def setup(self, trainer: Trainer, pl_module: LightningModule, stage: str) -> Non
342342

343343
# broadcast so that all ranks are in sync on future calls to .setup()
344344
self.already_saved = trainer.strategy.broadcast(self.already_saved)
345-
# Copying config file to log dir
346-
shutil.copyfile(self.config_path_original, self.config_path_new)
345+
# Copying config file to log dir only if they are different files
346+
if os.path.abspath(self.config_path_original) != os.path.abspath(self.config_path_new):
347+
shutil.copyfile(self.config_path_original, self.config_path_new)
347348

348349
class StateDictAwareModelCheckpoint(ModelCheckpoint):
349350
# necessary as we wish to have one model checkpoint with only state dict and one with standard lightning checkpoints

0 commit comments

Comments
 (0)