Created by: liym27
-
- pool2d pool3d op增强维度类报错信息。
-
- pool2d pool3d 英文文档中增加异常报错。 中文文档已修改 https://github.com/PaddlePaddle/FluidDoc/pull/1587
1. pool2d pool3d op增强维度类报错信息
以pool3d为例
import paddle.fluid as fluid
data = fluid.data(name='data', shape=[None, 3, 32, 32, 32], dtype='float32')
pool3d = fluid.layers.pool3d(
input = data,
pool_size = [2,2,2],
pool_type = "max",
pool_stride = [1,1,1],
global_pooling=False)
1. input 不是4-D 或 5-D
data = fluid.data(name='data', shape=[3, 32, 32], dtype='float32')
- 修改前报错
Pooling intput should be 4-D or 5-D tensor.
- 修改后报错
ShapeError: the input of Op(pool) should be 4-D or 5-D Tensor. But received: 3-D Tensor and it's shape is [3, 32, 32]
pool_ksize
的size大2
2. 输入维度应该比参数 data = fluid.data(name='data', shape=[None, 3, 32, 32], dtype='float32')
- 修改前报错:
Input size and pooling size should be consistent.
- 修改后报错:
ShapeError: the dimension of input minus the size of Attr(ksize) must be euqal to 2 in Op(pool). But received: the dimension of input minus the size of Attr(ksize) is 1, the input's dimension is 4, the shape of input is [-1, 3, 32, 32], the Attr(ksize)'s size is 3, the Attr(ksize) is [2, 2, 2].
strides
和 ksize
的元素数目不相等
3. - 修改前报错:
Strides size and pooling size should be the same.
- 修改后报错:
ShapeError: the size of Attr(ksize) and Attr(strides) in Op(pool) must be equal. But received: Attr(ksize)'s size is 3, Attr(strides)'s size is 2, Attr(ksize) is [3, 3, 3], Attr(strides)is [1, 1].
4. 计算出的输出值不大于0
- 修改前报错:
Due to the settings of padding(0,0), filter_size(40) and stride(2), the output size is not greater than 0, please check again. Input_size:32.
- 修改后报错
ShapeError: the output size must be greater than 0. But received: output_size = -3 due to the settings of input_size(32), padding(0,0), k_size(40) and stride(2). Please check again!