resize_bilinear输出的shape问题
Created by: littletomatodonkey
在使用resize_bilinear的时候,下面的代码输出的shape是(50,1,40,40),但是我看官网说明是以actual_shape为准的,所以不知道是不是自己写的有问题。 我在训练的时候,如果将数据喂进去之后,再去实时查看shape的话,输出的shape又是以actual_shape为准,所以对这一块有疑惑,不知道是否是resize_bilinear在build model的时候有问题呢?
import paddle
import paddle.fluid as fluid
a = fluid.layers.fill_constant(shape=[50,1,20,20], value=0, dtype='int64')
shape_a = fluid.layers.shape( a )
shape_nc, shape_hw = fluid.layers.split(shape_a, num_or_sections=[2,2])
output = fluid.layers.resize_bilinear(a, scale=2.0, actual_shape=shape_hw)
print( output.shape )