Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] fix 479 #480

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions terratorch/cli_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,9 @@ def setup(self, trainer: Trainer, pl_module: LightningModule, stage: str) -> Non

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

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