From 926fa206ff85d90d81723deace47e58196af7495 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 24 Jul 2019 11:45:59 -0400 Subject: [PATCH] added safeguards for callbacks in loading saving --- tests/debug.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/debug.py b/tests/debug.py index 9f2959af..21761baa 100644 --- a/tests/debug.py +++ b/tests/debug.py @@ -1,7 +1,7 @@ import pytest from pytorch_lightning import Trainer from pytorch_lightning.examples.new_project_templates.lightning_module_template import LightningTemplateModel -from test_tube.argparse_hopt import TTNamespace +from argparse import Namespace from test_tube import Experiment from pytorch_lightning.callbacks import ModelCheckpoint import numpy as np @@ -15,14 +15,14 @@ import pdb def get_model(): # set up model with these hyperparams root_dir = os.path.dirname(os.path.realpath(__file__)) - hparams = TTNamespace(**{'drop_prob': 0.2, - 'batch_size': 32, - 'in_features': 28*28, - 'learning_rate': 0.001*8, - 'optimizer_name': 'adam', - 'data_root': os.path.join(root_dir, 'mnist'), - 'out_features': 10, - 'hidden_dim': 1000}) + hparams = Namespace(**{'drop_prob': 0.2, + 'batch_size': 32, + 'in_features': 28*28, + 'learning_rate': 0.001*8, + 'optimizer_name': 'adam', + 'data_root': os.path.join(root_dir, 'mnist'), + 'out_features': 10, + 'hidden_dim': 1000}) model = LightningTemplateModel(hparams) return model, hparams @@ -61,7 +61,7 @@ def main(): # exp file to get meta exp = get_exp(False) - exp.add_meta_from_hyperopt(hparams) + exp.argparse(hparams) exp.save() # exp file to get weights