monikkinom / ner-lstm

Named Entity Recognition using multilayered bidirectional LSTM
539 stars 183 forks source link

ValueError: setting an array element with a sequence. #25

Open samevers opened 7 years ago

samevers commented 7 years ago

Hi, I was reported the following error, Anyone with me? And how to resolve it ? Thank you so much.

Traceback (most recent call last): File "model.py", line 122, in train(parser.parse_args()) File "model.py", line 94, in train model.output_data: train_out[ptr:ptr + args.batch_size]}) File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 767, in run run_metadata_ptr) File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 938, in _run np_val = np.asarray(subfeed_val, dtype=subfeed_dtype) File "/usr/lib64/python2.7/site-packages/numpy/core/numeric.py", line 532, in asarray return array(a, dtype, copy=False, order=order) ValueError: setting an array element with a sequence.

YovaKem commented 6 years ago

I reckon you are no longer concerned with this issue, but for future reference of other users, I'll share what turned out to be the issue in my case:

I had a different number of classes -- 2 instead of 5. The get_conll_embeddings script has the number 5 hard-coded on line 76. I changed that to two and the issue disappeared.