mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
Docs (#813)
* added outline of all features * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated common use cases doc * updated docs
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
Test set
|
||||
==========
|
||||
Lightning forces the user to run the test set separately to make sure it isn't evaluated by mistake
|
||||
|
||||
|
||||
Test after fit
|
||||
----------------
|
||||
To run the test set after training completes, use this method
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# run full training
|
||||
trainer.fit(model)
|
||||
|
||||
# run test set
|
||||
trainer.test()
|
||||
|
||||
|
||||
Test pre-trained model
|
||||
-----------------
|
||||
To run the test set on a pretrained model, use this method.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
model = MyLightningModule.load_from_metrics(
|
||||
weights_path='/path/to/pytorch_checkpoint.ckpt',
|
||||
tags_csv='/path/to/test_tube/experiment/version/meta_tags.csv',
|
||||
on_gpu=True,
|
||||
map_location=None
|
||||
)
|
||||
|
||||
# init trainer with whatever options
|
||||
trainer = Trainer(...)
|
||||
|
||||
# test (pass in the model)
|
||||
trainer.test(model)
|
||||
|
||||
In this case, the options you pass to trainer will be used when
|
||||
running the test set (ie: 16-bit, dp, ddp, etc...
|
||||
Reference in New Issue
Block a user