这个是复现的例子,麻烦相关同学看一下。
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)
暂无答案!
目前还没有任何答案,快来回答吧!