Skip to content

Commit e8b4e0d

Browse files
author
chengduo
authored
fix load_vars bug (#12869)
1 parent decda73 commit e8b4e0d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/paddle/fluid/io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ def name_has_fc(var):
406406
attrs={'file_path': os.path.join(dirname, filename)})
407407
executor.run(load_prog)
408408

409+
if main_program is None:
410+
main_program = default_main_program()
411+
409412
# load slice vars on pserver, if have it.
410413
_load_slice_up_vars(executor, dirname,
411414
main_program._slice_vars_and_attrs)

0 commit comments

Comments
 (0)