From e8b4e0d627176e4d4028698e48e1d67440913d88 Mon Sep 17 00:00:00 2001 From: chengduo Date: Wed, 22 Aug 2018 16:53:21 +0800 Subject: [PATCH] fix load_vars bug (#12869) --- python/paddle/fluid/io.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index b3ed094c892..5c4ec99c533 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -406,6 +406,9 @@ def load_vars(executor, attrs={'file_path': os.path.join(dirname, filename)}) executor.run(load_prog) + if main_program is None: + main_program = default_main_program() + # load slice vars on pserver, if have it. _load_slice_up_vars(executor, dirname, main_program._slice_vars_and_attrs) -- GitLab