From d4d0f54a3775353a2e3109dc938b0515d148896e Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 24 Jul 2019 15:48:35 -0400 Subject: [PATCH] removed dead code in model save --- tests/test_models.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/test_models.py b/tests/test_models.py index 5ed769a0..f7fd65e2 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -3,7 +3,7 @@ from pytorch_lightning import Trainer from pytorch_lightning.examples.new_project_templates.lightning_module_template import LightningTemplateModel from argparse import Namespace from test_tube import Experiment -from pytorch_lightning.callbacks import ModelCheckpoint +from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping from pytorch_lightning.utils.debugging import IncompatibleArgumentsException import numpy as np import warnings @@ -57,6 +57,28 @@ def test_all_features_cpu_model(): run_gpu_model_test(trainer_options, on_gpu=False) +def test_early_stopping_cpu_model(): + """ + Test each of the trainer options + :return: + """ + + stopping = EarlyStopping() + trainer_options = dict( + early_stop_callback=stopping, + gradient_clip=1.0, + overfit_pct=0.20, + track_grad_norm=2, + print_nan_grads=True, + progress_bar=False, + experiment=get_exp(), + max_nb_epochs=1, + train_percent_check=0.4, + val_percent_check=0.4 + ) + + run_gpu_model_test(trainer_options, on_gpu=False) + def test_single_gpu_model(): """ Make sure single GPU works (DP mode)