diff --git a/fluid/neural_machine_translation/transformer/train.py b/fluid/neural_machine_translation/transformer/train.py index 19835c486e06e1a3a955bdebfc552fc397ff7d9b..0494792c5180382139635ab70ef60d3f688e213b 100644 --- a/fluid/neural_machine_translation/transformer/train.py +++ b/fluid/neural_machine_translation/transformer/train.py @@ -140,7 +140,8 @@ def main(): lr_scheduler.update_learning_rate(data_input) outs = exe.run(fluid.framework.default_main_program(), feed=data_input, - fetch_list=[cost]) + fetch_list=[cost], + use_program_cache=True) cost_val = np.array(outs[0]) print("pass_id = " + str(pass_id) + " batch = " + str(batch_id) + " cost = " + str(cost_val))