fill_constant_batch_size_like 这个op 返回的输出tensor 和输入tensor batch_size不匹配
Created by: maosengshulei
1)PaddlePaddle版本: 支持fleet的paddle版本,版本不太确定 2)CPU:预测若用CPU,请提供CPU型号,MKL/OpenBlas/MKLDNN/等数学库使用情况 3)GPU:预测若用GPU,请提供GPU型号、CUDA和CUDNN版本号 4)系统环境:请您描述系统类型、版本,例如Mac OS 10.14,Python版本
- 训练信息 1)mpi多机训练 2)显存信息 3)Operator信息
- 复现信息:如为报错,请给出复现环境、复现步骤
- 问题描述:请详细描述您的问题,同步贴出报错信息、日志、可复现的代码片段 使用fill_constant_batch_size_like的代码部分如下:
self.label = fluid.layers.data(name="click", shape=[-1, 5], dtype="int64",
lod_level=0, append_batch_size=False)
self.temp_click_label = fluid.layers.slice(self.label, axes=[1], starts=[1], ends=[2])
self.cast_label = fluid.layers.cast(x=self.temp_click_label, dtype='float32')
fluid.layers.Print(input=self.cast_label,message="cast label element: ")
self.cast_label.stop_gradient = True
ones = fluid.layers.fill_constant_batch_size_like(input=self.cast_label, shape=[-1, 1], dtype="float32", value=1)
fluid.layers.Print(input=ones,message="ones element: ")
show_clk = fluid.layers.cast(fluid.layers.concat([ones, self.cast_label], axis=1), dtype='float32')
fluid.layers.Print(input=show_clk,message="show_click element: ")
在concat拼接生成show_clk这一步报错 mpi日志显示如下:
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554553 3417 operator.cc:166] CPUPlace Op(slice), inputs:{Input[click:int64_t[8, 5]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{Out[slice_0.tmp_0:[-1]({{}})]}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554577 3417 operator.cc:982] expected_kernel_key:data_type[int64_t]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554644 3417 operator.cc:187] CPUPlace Op(slice), inputs:{Input[click:int64_t[8, 5]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{Out[slice_0.tmp_0:int64_t[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554670 3417 operator.cc:166] CPUPlace Op(cast), inputs:{X[slice_0.tmp_0:int64_t[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{Out[cast_0.tmp_0:[-1]({{}})]}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554687 3417 operator.cc:982] expected_kernel_key:data_type[int64_t]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554734 3417 operator.cc:187] CPUPlace Op(cast), inputs:{X[slice_0.tmp_0:int64_t[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{Out[cast_0.tmp_0:float[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554754 3417 operator.cc:166] CPUPlace Op(print), inputs:{In[cast_0.tmp_0:float[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554842 3417 operator.cc:187] CPUPlace Op(print), inputs:{In[cast_0.tmp_0:float[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554872 3417 operator.cc:166] CPUPlace Op(fill_constant_batch_size_like), inputs:{Input[cast_0.tmp_0:float[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{Out[fill_constant_batch_size_like_0.tmp_0:[-1]({{}})]}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554888 3417 operator.cc:982] expected_kernel_key:data_type[float]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554944 3417 operator.cc:187] CPUPlace Op(fill_constant_batch_size_like), inputs:{Input[cast_0.tmp_0:float[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{Out[fill_constant_batch_size_like_0.tmp_0:float[32, 1]({})]}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.554965 3417 operator.cc:166] CPUPlace Op(print), inputs:{In[fill_constant_batch_size_like_0.tmp_0:float[32, 1]({})]}, outputs:{}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.555021 3417 operator.cc:187] CPUPlace Op(print), inputs:{In[fill_constant_batch_size_like_0.tmp_0:float[32, 1]({})]}, outputs:{}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.555042 3417 operator.cc:166] CPUPlace Op(concat), inputs:{X[fill_constant_batch_size_like_0.tmp_0:float[32, 1]({}), cast_0.tmp_0:float[8, 1]({{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21, 22, 24, 26, 27, 28, 29, 30, 32, 34, 36, 37, 39, 40, 41, 42}})]}, outputs:{Out[concat_0.tmp_0:[-1]({{}})]}.
Mon Jul 15 08:24:49 2019[1,5]<stderr>:I0715 08:24:49.555059 3417 operator.cc:982] expected_kernel_key:data_type[float]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
日志显示输入的batch_size 是8, 经过fill_constant_batch_size_like 后变成了32。
麻烦check下是哪里写的不对吗?