Skip to content

Instantly share code, notes, and snippets.

@amallia
Created November 12, 2021 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amallia/eeb33a114320b8389caa84fee0c41894 to your computer and use it in GitHub Desktop.
Save amallia/eeb33a114320b8389caa84fee0c41894 to your computer and use it in GitHub Desktop.
checkpoint_callback = ModelCheckpoint(dirpath=os.path.join(
os.getcwd(), "checkpoints"), filename='step{step:02d}-train_loss{train_loss:.3f}', auto_insert_metric_name=False, verbose=True, every_n_train_steps=250)
trainer = pl.Trainer.from_argparse_args(
args, callbacks=[checkpoint_callback], accumulate_grad_batches=2, gradient_clip_val=2)
trainer.fit(model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment