ocr attention模型用fluid.io.save_inference_model保存模型后,load运行报错
Created by: banbishan
我在infer.py里加了 path = "./infer_model" fluid.io.save_inference_model(dirname=path, feeded_var_names=['pixel'],target_vars=[ids])
import paddle.fluid as fluid
import numpy as np
file_name = 'demo_1_3_48_384_nchw_float'
file = np.fromfile(file_name,'f')
exe = fluid.Executor(fluid.CPUPlace())
path = "/mnt/e/docker/infer_model"
[inference_program, feed_target_names, fetch_targets] = fluid.io.load_inference_model(dirname=path, executor=exe)
results = exe.run(inference_program,
feed={feed_target_names[0]: file},
fetch_list=fetch_targets)