未验证 提交 b584b1ba 编写于 作者: S SunAhong1993 提交者: GitHub

Update merge_params.py

上级 78147269
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import sys import sys
model_dir = sys.argv[1] model_dir = sys.argv[1]
new_model_dir = sys.argv[2] new_model_dir = sys.argv[2]
exe = fluid.Executor(fluid.CPUPlace()) paddle.enable_static()
exe = paddle.static.Executor(paddle.CPUPlace())
[inference_program, feed_target_names, [inference_program, feed_target_names,
fetch_targets] = fluid.io.load_inference_model( fetch_targets] = paddle.static.load_inference_model(
dirname=model_dir, executor=exe) dirname=model_dir, executor=exe)
print(feed_target_names) print(feed_target_names)
fluid.io.save_inference_model( paddle.static.save_inference_model(
dirname=new_model_dir, dirname=new_model_dir,
feeded_var_names=feed_target_names, feeded_var_names=feed_target_names,
target_vars=fetch_targets, target_vars=fetch_targets,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册