HAN-text-classification-tf icon indicating copy to clipboard operation
HAN-text-classification-tf copied to clipboard

报错:setting an array element with a sequence

Open maoyanying opened this issue 7 years ago • 4 comments

你好,我运行你源码的时候,train.py里面的train_step报错:setting an array element with a sequence,试了一下你在博客下方评论区里说的解决方法解决不了,请问要怎么处理呀,能说得详细一点么?谢谢!

maoyanying avatar Sep 07 '17 03:09 maoyanying

你可以看看下面这两个链接: https://github.com/lc222/HAN-text-classification-tf/issues/1 http://blog.csdn.net/liuchonge/article/details/77854689

lc222 avatar Sep 07 '17 03:09 lc222

谢谢你!我改了下代码,能跑通train.py了,但是跑到循环282次时就报错了,错误如下: ValueError: Cannot feed value of shape (0,) for Tensor u'placeholder/input_x:0', which has shape '(?, ?, ?)' test.py也不能运行,错误如下: File "test.py", line 54, in xx, xy, xz, xw, xu= sess.run([x3, u_ww, uu, uu1, u_context]) InvalidArgumentError (see above for traceback): Requires start <= limit when delta > 0: 2/1 [[Node: range_1 = Range[Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](range_1/start, Sub, range_1/delta)]]

请问你遇到这种情况了吗?你能运行test.py文件吗?你怎么解决呀?

maoyanying avatar Sep 07 '17 10:09 maoyanying

首先test的代码只是我用来评测某个函数写的是否正确的==并不是跟train对应的模型的predict代码。所以可能本身就跑不通。其次跑到282次循环出错我感觉因该是你数据的问题。可以去查看一下该次循环所对应的数据是否有问题,按照错误提示feed的数据大小是0

lc222 avatar Sep 07 '17 13:09 lc222

好的,谢谢!

maoyanying avatar Sep 07 '17 13:09 maoyanying