From e188b6196024d0939ef27b41b31e2a4d4048d7f5 Mon Sep 17 00:00:00 2001 From: Isaac Sijaranamual Date: Sun, 10 Dec 2017 22:52:26 +0100 Subject: [PATCH] Make cli/train.py not eat exception --- spacy/cli/train.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spacy/cli/train.py b/spacy/cli/train.py index 6697ed6c0..fff890ca1 100644 --- a/spacy/cli/train.py +++ b/spacy/cli/train.py @@ -165,12 +165,9 @@ def train(cmd, lang, output_dir, train_data, dev_data, n_iter=30, n_sents=0, gpu_wps=gpu_wps) finally: print("Saving model...") - try: - with (output_path / 'model-final.pickle').open('wb') as file_: - with nlp.use_params(optimizer.averages): - dill.dump(nlp, file_, -1) - except: - print("Error saving model") + with (output_path / 'model-final.pickle').open('wb') as file_: + with nlp.use_params(optimizer.averages): + dill.dump(nlp, file_, -1) def _render_parses(i, to_render):