diff --git a/fluid/machine_reading_comprehesion/DuReader/run.py b/fluid/machine_reading_comprehesion/DuReader/run.py index 1fb6fd4e33d1c775c9486ab2971be109d89224ce..2f9d34db02aa76d3c2e2dfd5309bc3c324fbeee7 100644 --- a/fluid/machine_reading_comprehesion/DuReader/run.py +++ b/fluid/machine_reading_comprehesion/DuReader/run.py @@ -385,8 +385,9 @@ def evaluate(logger, args): ] feeder = fluid.DataFeeder(feed_list, place) + inference_program = main_program.clone(for_test=True) eval_loss, bleu_rouge = validation( - main_program, avg_cost, s_probs, e_probs, + inference_program, avg_cost, s_probs, e_probs, feed_order, place, vocab, brc_data, logger, args) logger.info('Dev eval loss {}'.format(eval_loss)) logger.info('Dev eval result: {}'.format(bleu_rouge)) @@ -431,8 +432,9 @@ def predict(logger, args): ] feeder = fluid.DataFeeder(feed_list, place) + inference_program = main_program.clone(for_test=True) eval_loss, bleu_rouge = validation( - main_program, avg_cost, s_probs, e_probs, + inference_program, avg_cost, s_probs, e_probs, feed_order, place, vocab, brc_data, logger, args) diff --git a/fluid/machine_reading_comprehesion/DuReader/run.sh b/fluid/machine_reading_comprehesion/DuReader/run.sh index 076ec920930b8feedc6a730d8c88668ca2183d4f..e3476074578e31111e5b1e2a8b834499e86f517d 100644 --- a/fluid/machine_reading_comprehesion/DuReader/run.sh +++ b/fluid/machine_reading_comprehesion/DuReader/run.sh @@ -17,6 +17,4 @@ python run.py \ --max_p_len 500 \ --max_q_len 60 \ --max_a_len 200 \ ---drop_rate 0.2 \ ---train \ ---test +--drop_rate 0.2 $@\