In addition to what @goku said, you can get the log directory + version number with: trainer.logger.log_dir
, so if you add what you want as a callback:
from pytorch_lightning.callbacks import Callback
class OnCheckpointSomething(Callback):
def on_save_checkpoint(self, trainer, pl_module):
save_path = f"{trainer.logger.log_dir}/checkpoints/epoch={trainer.current_epoch}.ckpt"