Paddle BUG: pow op 发现cpu和gpu输出不一致的情况,

j0pj023g  于 2021-11-30  发布在  Java
关注(0)|答案(0)|浏览(296)

这个是复现的例子,麻烦相关同学看一下。

import numpy as np
import paddle.fluid as fluid
inputs = fluid.layers.data(dtype = 'float32', shape = [3, 480, 640], name = 'fc')
scale_out = fluid.layers.scale(
        inputs, scale= 0.00392156885937, bias=0, bias_after_scale=True)
output = fluid.layers.pow(scale_out, factor=1.0)

# exe = fluid.Executor(fluid.CPUPlace())

exe = fluid.Executor(fluid.CUDAPlace(0))
exe.run(fluid.default_startup_program())
img = np.loadtxt("input.txt").astype(np.float32)
print(img.shape)
print(np.sum(img))
img = img.reshape((1, 3, 480, 640))
res, = exe.run(fluid.default_main_program(), feed={'fc':img}, fetch_list=[output])
print(res)

输入数据:

input.txt

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题