-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
ModelCheckpoint with save_best_only=True deletes everything in the checkpointing directory before saving the new checkpoint. If the checkpointing directory is not set correctly, it might delete other files that it shouldn't be deleting. While seems unlikely, it is not, because the documentation here [https://github.com/williamFalcon/pytorch-lightning/blob/e0dbc8ab46450fc485f8f2a5c2c996cd1f442a92/pytorch_lightning/trainer/trainer_io.py#L19] uses filepath=os.getcwd(),, which means it will delete the current working directory with the first checkpoint.
Two things need to be fixed:
- Instead of deleting everything, just overwrite old checkpoint files.
- Updating the documentation to point to a different default directory so that people don't delete their cwd by mistake.
It would also be nice to show an example how to useTestTubeLoggerwithModelCheckpoint, something likefilepath=os.path.join(logger.name, f'version_{logger.version}', "checkpoints")
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working