提交 4c8b9537 编写于 作者: S SunAhong1993

fix the path str

上级 4a913c7c
......@@ -518,7 +518,7 @@ class PaddleGraph(object):
use_structured_name = False if self.source_type in ["tf"] else True
self.run_func.extend(
gen_codes(["paddle.disable_static()",
"params = paddle.load('{}/model.pdparams')".format(osp.abspath(code_dir)),
"params = paddle.load('{}')".format(osp.join(osp.abspath(code_dir), "model.pdparams")),
"model = {}()".format(self.name),
"model.set_dict(params, use_structured_name={})".format(use_structured_name),
"model.eval()",
......
......@@ -388,7 +388,7 @@ class HierarchicalTree(Tree):
run_func_list.append(" # {}: shape-{},type-{}。".format(k, v[0], v[1]))
run_func_list.extend(
[" paddle.disable_static()",
" params = paddle.load('{}/model.pdparams')".format(osp.abspath(save_dir)),
" params = paddle.load('{}')".format(osp.join(osp.abspath(save_dir), "model.pdparams")),
" model = {}()".format(self.pd_graph.name),
" model.set_dict(params)",
" model.eval()",
......
......@@ -354,7 +354,7 @@ class ModuleGraph(object):
run_func_list.append(" # {}: shape-{},type-{}.".format(k, v[0], v[1]))
run_func_list.extend(
[" paddle.disable_static()",
" params = paddle.load('{}/model.pdparams')".format(osp.abspath(save_dir)),
" params = paddle.load('{}')".format(osp.join(osp.abspath(save_dir), "model.pdparams")),
" model = {}()".format(self.pd_graph.name),
" model.set_dict(params)",
" model.eval()",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册