Invoke operator merge_lod_tensor error
Created by: Cristhine
模仿rcnn中ifelse语句实现在slice函数使用前不同语句; 在成功运行几十次之后报错: Traceback (most recent call last): File "train.py", line 249, in train() File "train.py", line 177, in train fetch_list=[v.name for v in fetch_list]) File "/home/vis/duyuting/app/python-cuda8-paddle-0.15.1/lib/python2.7/site-packages/paddle/fluid/executor.py", line 666, in run return_numpy=return_numpy) File "/home/vis/duyuting/app/python-cuda8-paddle-0.15.1/lib/python2.7/site-packages/paddle/fluid/executor.py", line 528, in _run_parallel exe.run(fetch_var_names, fetch_var_name) paddle.fluid.core_avx.EnforceNotMet: Invoke operator merge_lod_tensor error. Python Callstacks: File "/home/vis/duyuting/app/python-cuda8-paddle-0.15.1/lib/python2.7/site-packages/paddle/fluid/framework.py", line 1771, in append_op attrs=kwargs.get("attrs", None)) File "/home/vis/duyuting/app/python-cuda8-paddle-0.15.1/lib/python2.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(args, kwargs) File "/home/vis/duyuting/app/python-cuda8-paddle-0.15.1/lib/python2.7/site-packages/paddle/fluid/layers/control_flow.py", line 133, in merge_lod_tensor attrs={'level': level}) File "/home/vis/duyuting/app/python-cuda8-paddle-0.15.1/lib/python2.7/site-packages/paddle/fluid/layers/control_flow.py", line 1678, in call level=0)) File "/home/vis/duyuting/code/yolov3_drive2/models/yolov3.py", line 232, in build_model self.new_proposals = ie()[0] File "train.py", line 46, in train model.build_model() File "train.py", line 249, in train() C++ Callstacks: Input(InTrue) or Input(InFalse) should be initialized. at [/home/vis/wangjian33/code/Paddle/paddle/fluid/operators/merge_lod_tensor_op.cc:48] PaddlePaddle Call Stacks: 0 0x7fad83189790p void paddle::platform::EnforceNotMet::Init<char const>(char const, char const, int) + 352
代码如下: self.proposals = self.get_proposals() 217 fluid.layers.Print(self.proposals,message="self.proposals") 218 pred_res_shape = fluid.layers.shape(self.proposals) 219 shape = fluid.layers.reduce_prod(pred_res_shape) 220 shape = fluid.layers.reshape(shape, [1, 1]) 221 ones = fluid.layers.fill_constant([1, 1], value=1, dtype='int32') 222 cond = fluid.layers.equal(x=shape, y=ones) 223 ie = fluid.layers.IfElse(cond) 224 with ie.true_block(): 225 pred_res_null = ie.input(self.proposals) 226 ie.output(pred_res_null) 227 with ie.false_block(): 228 pred_res = ie.input(self.proposals) 229 #, self.new_proposals = fluid.layers.split(input=pred_res, num_or_sections=[2,4], di m=1) 230 pred_boxes = fluid.layers.slice(pred_res, [1], starts=[2], ends=[6]) 231 ie.output(pred_boxes) 232 self.new_proposals = ie()[0] 233 #, self.new_proposals = fluid.layers.split(input=self.proposals, num_or_sections=[2,4], dim=1)