From f747cf552346ddd68ab9dcd0ee1b2b65bca45d37 Mon Sep 17 00:00:00 2001 From: phlrain Date: Thu, 6 Feb 2020 16:28:30 +0000 Subject: [PATCH] change set_program_set to load; test=develop --- PaddleNLP/PaddleLARK/BERT/utils/init.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PaddleNLP/PaddleLARK/BERT/utils/init.py b/PaddleNLP/PaddleLARK/BERT/utils/init.py index 866f0d92..8948eae5 100644 --- a/PaddleNLP/PaddleLARK/BERT/utils/init.py +++ b/PaddleNLP/PaddleLARK/BERT/utils/init.py @@ -59,11 +59,10 @@ def init_pretraining_params(exe, pretraining_params_path, main_program, use_fp16=False): - assert os.path.exists(pretraining_params_path + ".params" - ), "[%s] cann't be found." % (pretraining_params_path + ".params" ) + assert os.path.exists(pretraining_params_path + ), "[%s] cann't be found." % pretraining_params_path - program_state = fluid.load_program_state( pretraining_params_path ) - fluid.set_program_state( main_program, program_state) + fluid.load( main_program, pretraining_params_path, exe) print("Load pretraining parameters from {}.".format( pretraining_params_path)) -- GitLab