Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

the provided recursive_sequence_lengths info is invalid

Open zhouksh opened this issue 7 years ago • 1 comments

Traceback (most recent call last):
  File "test_paddle3.py", line 31, in <module>
    lod_tensor = fluid.create_lod_tensor(np.array(data), [[49, 5], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1]], fluid.CPUPlace())
  File "software/paddle_release_home/python/lib/python2.7/site-packages/paddle/fluid/lod_tensor.py", line 83, in create_lod_tensor
    tensor.set_recursive_sequence_lengths(recursive_seq_lens)
paddle.fluid.core.EnforceNotMet: the provided recursive_sequence_lengths info is invalid at [/paddle/paddle/fluid/pybind/pybind.cc:253]
PaddlePaddle Call Stacks:
0       0x7f421fa06246p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 486
1       0x7f421f9fcaa7p
2       0x7f421fa1c0d4p pybind11::cpp_function::dispatcher(_object*, _object*, _object*) + 2596
3       0x7f4266548bb8p PyEval_EvalFrameEx + 25016
4       0x7f426654c0bdp PyEval_EvalCodeEx + 2061
5       0x7f4266549345p PyEval_EvalFrameEx + 26949
6       0x7f426654c0bdp PyEval_EvalCodeEx + 2061
7       0x7f426654c1f2p PyEval_EvalCode + 50
8       0x7f4266574f42p PyRun_FileExFlags + 146
9       0x7f42665762d9p PyRun_SimpleFileExFlags + 217
10      0x7f426658c00dp Py_Main + 3149
11      0x7f4265789bd5p __libc_start_main + 245
12            0x4007a1p

zhouksh avatar Dec 19 '18 02:12 zhouksh

看起来数据不对,样例可以参考文档: http://paddlepaddle.org/documentation/docs/zh/1.2/user_guides/howto/prepare_data/feeding_data.html#id4 ,这里也有一些关于LoDTensor的讨论:https://github.com/PaddlePaddle/Paddle/issues/10855

Yancey0623 avatar Dec 19 '18 06:12 Yancey0623