跑项目老是出错
收藏
项目里跑程序总是有这个错误是为啥啊
Error: Need to Create DeviceContextPool first!
[Hint: pool should not be null.] at (/paddle/paddle/fluid/platform/device_context.h:456)
[operator < fill_constant > error]
0
收藏
请登录后评论
代码就是官方文档里复制的一段
import paddle.fluid as fluid
data = fluid.layers.fill_constant(shape=[3, 4], value=16, dtype='int64')
dataPrint = fluid.layers.Print(data, message="Print data:")
place = fluid.CPUPlace()
exe = fluid.Executor(place)
exe.run(fluid.default_startup_program())
ret = exe.run(data)
这个右上角菜单, 重启一下执行器就行了. 或者升个更高的版本.
这个问题很奇怪, 一直没怎么定位到