创建LoDTensor错误
Created by: zhaocaibei123
代码如下:
`while line:
`fids = line[0]`
`fids = [[f] for f in fids]`
` lods = line[1]`
` labels = line[2]`
` print fids`
` print lods`
` print labels`
` feas = fluid.LoDTensor()`
` feas.set(fids, fluid.CPUPlace())`
` feas.set_lod(lods)`
` line = test_reader.next()`
报错信息如下:
[[1], [3], [5], [7], [9], [2], [4], [6], [8], [10], [1], [2], [3], [4]]
[[5, 5, 4]]
[1, 0, 0]
Traceback (most recent call last):
File "net.py", line 146, in <module>
network(look_up_size)
File "net.py", line 122, in network
feas.set_lod(lods)
paddle.fluid.core.EnforceNotMet: the provided lod info is invalid at [/home/ssd3/zhaocaibei/git/baidu/paddlepaddle/paddle/Paddle/paddle/fluid/pybind/pybind.cc:174]
PaddlePaddle Call Stacks:
0 0x7f1f8f14a0d2p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 482
1 0x7f1f8f142f29p
2 0x7f1f8f15899fp pybind11::cpp_function::dispatcher(_object*, _object*, _object*) + 2303
3 0x7f200655cbb8p PyEval_EvalFrameEx + 25016
4 0x7f200655d460p PyEval_EvalFrameEx + 27232
5 0x7f20065600bdp PyEval_EvalCodeEx + 2061
6 0x7f20065601f2p PyEval_EvalCode + 50
7 0x7f2006588f42p PyRun_FileExFlags + 146
8 0x7f200658a2d9p PyRun_SimpleFileExFlags + 217
9 0x7f20065a000dp Py_Main + 3149
10 0x7f200579dbd5p __libc_start_main + 245
11 0x4007a1p