Hi, I want to save the best model (as defined by the lowest val_loss) in TL. I am using Colab. Unfortunately, I can’t see the checkpoint file over there…
checkpoint_callback = ModelCheckpoint(
monitor='val_loss',
dirpath='/content',
filename='sst-{epoch:02d}-{val_loss:.2f}',
mode='min'
)
followed by
trainer = pl.Trainer(max_epochs=2, num_sanity_val_steps=1, logger=csvlogger, gpus=1, callbacks=[checkpoint_callback])
trainer.fit(model, train_dataloader=train_iterator, val_dataloaders=test_iterator)
checkpoint_callback.best_model_path
(Note the last line returns/prints an empty string)
I presume that then I have to use the following line to load the weights
model = classifier.load_from_checkpoint(???) #only if I can find the .ckpt file
Can someone help please?