paddle使用run()提示fetch错误
Created by: weiexcelpro
如何解决谢谢
代码如下:
from paddle import fluid a = fluid.layers.fill_constant(shape=[2,1],dtype='int64',value=5) b = fluid.layers.fill_constant(shape=[2,1],dtype='int64',value=6)
ifcond = fluid.layers.less_than(x=a,y=b) ie = fluid.layers.IfElse(ifcond) with ie.true_block(): c = ie.input(a) c += 1 ie.output(c)
exe = fluid.Executor(fluid.CPUPlace())#CPU上执行传入
exe.run(fluid.default_main_program(),fetch_list=[c])
Error: Cannot find fetch variable in scope, fetch_var_name is tmp_0 at (D:\1.7.1\paddle\paddle\fluid\operators\controlflow\fetch_op.cc:38) [operator < fetch > error]