From cdcff5fd9028828d08f19f83f307a27b25d70244 Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Mon, 3 Sep 2018 09:56:39 +0000 Subject: [PATCH] Set random_see before network creating in ce --- fluid/sequence_tagging_for_ner/train.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fluid/sequence_tagging_for_ner/train.py b/fluid/sequence_tagging_for_ner/train.py index e8191df9..f18300e1 100644 --- a/fluid/sequence_tagging_for_ner/train.py +++ b/fluid/sequence_tagging_for_ner/train.py @@ -55,6 +55,9 @@ def main(train_data_file, word_dict_len = len(word_dict) label_dict_len = len(label_dict) + if "CE_MODE_X" in os.environ: + fluid.default_startup_program().random_seed = 110 + avg_cost, feature_out, word, mark, target = ner_net( word_dict_len, label_dict_len, parallel) @@ -98,8 +101,6 @@ def main(train_data_file, feeder = fluid.DataFeeder(feed_list=[word, mark, target], place=place) exe = fluid.Executor(place) - if "CE_MODE_X" in os.environ: - fluid.default_startup_program().random_seed = 110 exe.run(fluid.default_startup_program()) embedding_name = 'emb' -- GitLab