未验证 提交 541b2293 编写于 作者: Y Yibing Liu 提交者: GitHub

Add more info in init (#4015)

上级 aeaf7886
...@@ -44,7 +44,9 @@ def init_checkpoint(exe, init_checkpoint_path, main_program, use_fp16=False): ...@@ -44,7 +44,9 @@ def init_checkpoint(exe, init_checkpoint_path, main_program, use_fp16=False):
def existed_persitables(var): def existed_persitables(var):
if not fluid.io.is_persistable(var): if not fluid.io.is_persistable(var):
return False return False
return os.path.exists(os.path.join(init_checkpoint_path, var.name)) if os.path.exists(os.path.join(init_checkpoint_path, var.name)):
print("INIT {}".format(var.name))
return True
fluid.io.load_vars( fluid.io.load_vars(
exe, exe,
...@@ -67,7 +69,12 @@ def init_pretraining_params(exe, ...@@ -67,7 +69,12 @@ def init_pretraining_params(exe,
def existed_params(var): def existed_params(var):
if not isinstance(var, fluid.framework.Parameter): if not isinstance(var, fluid.framework.Parameter):
return False return False
return os.path.exists(os.path.join(pretraining_params_path, var.name)) if os.path.exists(os.path.join(pretraining_params_path, var.name)):
print("INIT {}".format(var.name))
return True
else:
print("SKIP {}".format(var.name))
return False
fluid.io.load_vars( fluid.io.load_vars(
exe, exe,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册