conv_transpose 相同的输入得到的输出不同
Created by: ceci3
conv_transpose gpu版本filter_size>3的条件下固定输入和参数,多次运行得到的结果不同。(在Kernel里调试发现: 在cudnnConvolutionBackwardData之前打印的input和filter相同,经过cudnnConvolutionBackwardData计算之后的output不同) paddle环境:1.5.2和1.6.1都会出现。
测试代码: `import paddle.fluid as fluid
def test(place, data): input = fluid.layers.data(dtype='float32', shape=[None, 128, 8, 8], name='data') param_attr = fluid.ParamAttr(name='tc_w', initializer=fluid.initializer.Constant(1.0), trainable=True) result = fluid.layers.conv2d_transpose(input, num_filters=128, bias_attr=None, param_attr=param_attr, filter_size=4, act=None)
exe = fluid.Executor(place)
exe.run(fluid.default_startup_program())
main_program=fluid.default_main_program())
res, = exe.run(feed={'data':data}, fetch_list=[result])
return res
import numpy import numpy as np numpy.random.seed(13) #data = numpy.loadtxt("result_batch_norm_81.tmp_3.txt").reshape((1, 128, 8, 8)).astype(np.float32) data = np.random.rand(1, 128, 8, 8).astype(np.float32) res_gpu = test(fluid.CUDAPlace(0), data) np.savetxt("result1_c.txt", res_gpu[0].reshape((-1, 1))) print res_gpu`