From 9983e3a92d648ecf4fd92ba247eee9454a8c57d9 Mon Sep 17 00:00:00 2001 From: wuxing_iie <47976816+XingWu01@users.noreply.github.com> Date: Tue, 11 Feb 2020 20:15:53 +0800 Subject: [PATCH] fix_lac_dygraph_to_1.7 (#4258) Co-authored-by: Xing Wu --- dygraph/lac/eval.py | 2 +- dygraph/lac/predict.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dygraph/lac/eval.py b/dygraph/lac/eval.py index f3bbd82c..03b41eff 100755 --- a/dygraph/lac/eval.py +++ b/dygraph/lac/eval.py @@ -49,7 +49,7 @@ def do_eval(args): load_path = args.init_checkpoint state_dict, _ = fluid.dygraph.load_dygraph(load_path) #import ipdb; ipdb.set_trace() - state_dict["crf_decoding_0.crfw"]=state_dict["linear_chain_crf_0.crfw"] + state_dict["linear_chain_crf.weight"]=state_dict["crf_decoding.weight"] model.set_dict(state_dict) model.eval() chunk_eval = Chunk_eval(int(math.ceil((dataset.num_labels - 1) / 2.0)), "IOB") diff --git a/dygraph/lac/predict.py b/dygraph/lac/predict.py index ab22b70d..6431f76b 100755 --- a/dygraph/lac/predict.py +++ b/dygraph/lac/predict.py @@ -50,7 +50,7 @@ def do_infer(args): load_path = args.init_checkpoint state_dict, _ = fluid.dygraph.load_dygraph(load_path) #import ipdb; ipdb.set_trace() - state_dict["crf_decoding_0.crfw"]=state_dict["linear_chain_crf_0.crfw"] + state_dict["linear_chain_crf.weight"]=state_dict["crf_decoding.weight"] model.set_dict(state_dict) model.eval() chunk_eval = Chunk_eval(int(math.ceil((dataset.num_labels - 1) / 2.0)), "IOB") -- GitLab