Hironsan / anago

Bidirectional LSTM-CRF and ELMo for Named-Entity Recognition, Part-of-Speech Tagging and so on.
https://anago.herokuapp.com/
MIT License
1.48k stars 371 forks source link

ValueError in "anago/trainer.py" #81

Open Green-li opened 5 years ago

Green-li commented 5 years ago

Error as follows:

Traceback (most recent call last):
  File "train.py", line 59, in <module>
    model.fit(x_train, y_train, x_valid, y_valid, epochs=30, batch_size=32, callbacks=callbacks)
  File "/home/mlli6/venv/lib/python3.6/site-packages/anago/wrapper.py", line 87, in fit
    shuffle=shuffle)
  File "/home/mlli6/venv/lib/python3.6/site-packages/anago/trainer.py", line 42, in train
    if x_valid and y_valid:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

i change it to x _valid.all() and y_valid.all(), then it works. So does this the same meaning to your origin code?