From b1f6c49bd3fca00d0fad7b98a03214a73e4332da Mon Sep 17 00:00:00 2001 From: NicEggert Date: Tue, 22 Oct 2019 16:17:39 -0500 Subject: [PATCH] Update docs --- docs/LightningModule/methods.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/LightningModule/methods.md b/docs/LightningModule/methods.md index cb96ea7a..a4325938 100644 --- a/docs/LightningModule/methods.md +++ b/docs/LightningModule/methods.md @@ -10,8 +10,25 @@ model.freeze() --- ### load_from_metrics -This is the easiest/fastest way which uses the meta_tags.csv file from test-tube to rebuild the model. -The meta_tags.csv file can be found in the test-tube experiment save_dir. +This is the easiest/fastest way which loads hyperparameters and weights from a checkpoint, +such as the one saved by the `ModelCheckpoint` callback + +```{.python} +pretrained_model = MyLightningModule.load_from_checkpoint( + checkpoint_path='/path/to/pytorch_checkpoint.ckpt' +) + +# predict +pretrained_model.eval() +pretrained_model.freeze() +y_hat = pretrained_model(x) +``` + +--- +### load_from_metrics +If you're using test tube, there is an alternate method which uses the meta_tags.csv +file from test-tube to rebuild the model. The meta_tags.csv file can be found in the +test-tube experiment save_dir. ```{.python} pretrained_model = MyLightningModule.load_from_metrics(