From 53bbbbfa22af0feb83ef9a76fdee302e4b4f56ee Mon Sep 17 00:00:00 2001 From: bojar Date: Tue, 15 Aug 2006 15:16:28 +0000 Subject: [PATCH] --continue now also attempts to step one extra step back if necessary moses output is not found git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@754 1f5c12ca-751b-0410-a591-d2e778427230 --- scripts/training/mert-moses.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/training/mert-moses.pl b/scripts/training/mert-moses.pl index 2bcdf9f63..d82e9d944 100755 --- a/scripts/training/mert-moses.pl +++ b/scripts/training/mert-moses.pl @@ -377,10 +377,15 @@ if ($continue) { chomp $step; $step++; close IN; - $start_run = $step +1; - die "Can't start from step $step, because run$step.best$___N_BEST_LIST_SIZE.out.gz was not found!" - if ! -e "run$step.best$___N_BEST_LIST_SIZE.out.gz"; + if (! -e "run$step.best$___N_BEST_LIST_SIZE.out.gz") { + # allow stepping one extra iteration back + $step--; + die "Can't start from step $step, because run$step.best$___N_BEST_LIST_SIZE.out.gz was not found!" + if ! -e "run$step.best$___N_BEST_LIST_SIZE.out.gz"; + } + + $start_run = $step +1; print STDERR "Reading last cached lambda values (result from step $step)\n"; @order_of_lambdas_from_decoder = get_order_of_scores_from_nbestlist("gunzip -c < run$step.best$___N_BEST_LIST_SIZE.out.gz |");