place = fluid.CPUPlace()
exe = fluid.Executor(place)
exe.run(fluid.default_startup_program())
program, feed_target_names, fetch_targets = fluid.io.load_inference_model('fluid_model', exe,params_filename='param')
for i in range(0,len(program.blocks)):
print i,program.blocks[i].vars.keys()
ValueErrorTraceback (most recent call last)
<ipython-input-6-8dca9fe8d449> in <module>()
29 'cell_init':init_zero,'data_lod_attention':lod_attention,
30 'temp1_var':temp1_var,'temp2_var':temp2_var},
---> 31 fetch_list=['final_output.tmp_1'],return_numpy=False)
32 print results[0].lod()
33 print np.array( results[0] )
/lib/python2.7/site-packages/paddle/fluid/executor.pyc in run(self, program, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache)
335 fetch_list=fetch_list,
336 feed_var_name=feed_var_name,
--> 337 fetch_var_name=fetch_var_name)
338
339 self._feed_data(program, feed, feed_var_name, scope)
lib/python2.7/site-packages/paddle/fluid/executor.pyc in _add_feed_fetch_ops(self, program, feed, fetch_list, feed_var_name, fetch_var_name)
230 if not has_feed_operators(global_block, feed, feed_var_name):
231 for i, name in enumerate(feed):
--> 232 out = global_block.var(name)
233 global_block.prepend_op(
234 type='feed',
/home/map/xuhao/code/tmp/python-gcc482-paddle/lib/python2.7/site-packages/paddle/fluid/framework.pyc in var(self, name)
722 v = self.vars.get(name, None)
723 if v is None:
--> 724 raise ValueError("var %s not in this block" % name)
725 return v
726
ValueError: var temp1_var not in this block
输出
输出
输出
但当我输入数据进行predict时报错
输出报错