Skip to content

Instantly share code, notes, and snippets.

@williamFalcon
Created March 18, 2020 15:31
Show Gist options
  • Save williamFalcon/214d5b7e92301b19783e6456e9f1dfc7 to your computer and use it in GitHub Desktop.
Save williamFalcon/214d5b7e92301b19783e6456e9f1dfc7 to your computer and use it in GitHub Desktop.
import pytorch_lightning as pl
class MyPrintingCallback(pl.Callback):
def on_init_start(self, trainer):
print('Starting to init trainer!')
def on_init_end(self, trainer):
print('trainer is init now')
def on_train_end(self, trainer, pl_module):
print('do something when training ends')
# pass to trainer
trainer = pl.Trainer(callbacks=[MyPrintingCallback()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment