Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

运行时报Check failed: in_->ids错误

Open youan1 opened this issue 9 years ago • 5 comments

issue_script_and_input_case.zip

麻烦看看上述脚本哪里错了,相应脚本为1.py,输入的base case为issue_sample,错误如下:

image

谢谢!

youan1 avatar Jul 14 '17 08:07 youan1

看以来像是数据feeding有问题,但不确定是哪个slot的问题。另外,我没能跑起来你给的这个例子。

hedaoyuan avatar Jul 14 '17 08:07 hedaoyuan

接embedding层的lyaer.data需要用integer_value,而不是sparse_binary_vector。 参考这里

data1 = paddle.layer.data("slot1",
                          paddle.data_type.sparse_binary_vector(
                              slot1_size))
data2 = paddle.layer.data("slot2",
                          paddle.data_type.sparse_binary_vector(
                              slot2_size))
data3 = paddle.layer.data("slot3",
                          paddle.data_type.sparse_binary_vector(
                              slot3_size))
data4 = paddle.layer.data("slot4",
                          paddle.data_type.sparse_binary_vector(
                              slot4_size))

hedaoyuan avatar Jul 14 '17 09:07 hedaoyuan

@youan1 上面那个回复有问题,如果样本中是序列数据,应该用integer_value_sequence才对。

hedaoyuan avatar Jul 14 '17 14:07 hedaoyuan

  • @youan1 请尽量不要在 issue 中贴图片,不能够被其它用户搜索到。请优先自己调试。

  • 上面的出错信息是embedding 层需要接受 word index 作为输入,但是这一层现在的数据输出是空。通常都是因为data layer 中使用了错误的数据类型,而 reader 中也返回了错误的类型,导致 embedding层去读取数据时,数据为空。请检查data layer 使用的数据类型,以及reader是否返回了该类型。@hedaoyuan 是对的,应该使用 integer_value_sequence 而不是 sparse_binary_vector。

  • 如果却是因为我们文档缺失造成使用不便利,请尽管提issue给我们,我们会通过文档来close此issue。

lcy-seso avatar Jul 15 '17 01:07 lcy-seso

在issue中贴图片的问题,您说的对,这样使得答疑结果不能被大家更好的共享,下次会注意

另外参考文档使用integer_value_sequence时,其解释为"Data type of a sequence of integer",这里有不解,认为是输入是一个序列类型(类比dense_vector和dense_vector_sequence )而我们的输入是无序集合,所以才请paddle同学 帮忙看看

youan1 avatar Jul 15 '17 04:07 youan1