From 245ef862f8ba5b79cecea9b5365306347f87b467 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 24 Jul 2019 11:38:16 -0400 Subject: [PATCH] added safeguards for callbacks in loading saving --- tests/debug.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/debug.py b/tests/debug.py index c0d845c5..d3e478a4 100644 --- a/tests/debug.py +++ b/tests/debug.py @@ -87,7 +87,12 @@ def main(): pdb.set_trace() tags_path = exp.get_data_path(exp.name, exp.version) tags_path = os.path.join(tags_path, 'meta_tags.csv') - trained_model = LightningTemplateModel.load_from_metrics(weights_path=save_dir, tags_csv=tags_path, on_gpu=True) + + pdb.set_trace() + checkpoints = [x for x in os.listdir(save_dir) if '.ckpt' in x] + weights_dir = os.path.join(save_dir, checkpoints[0]) + + trained_model = LightningTemplateModel.load_from_metrics(weights_path=weights_dir, tags_csv=tags_path, on_gpu=True) # run prediction for batch in model.test_dataloader: