qhduan / just_another_seq2seq

Just another seq2seq repo
329 stars 97 forks source link

ner/train_crf_loss.py Error #9

Closed 666XD closed 3 years ago

666XD commented 6 years ago

目前program run 在 ubuntu python3.5 在 ner/train_crf_loss.py 142 行的測試的部分,遇到以下的 Error

try load model from ./s2ss_crf.ckpt 0%| | 0/100 [00:00<?, ?it/s]Traceback (most recent call last):

File "train_crf_loss.py", line 179, in <module> main() File "train_crf_loss.py", line 175, in main test(True, 'lstm', 1, False, True, False, 64, 'tanh') File "train_crf_loss.py", line 142, in test if rr: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

看了一下 rr 是 numpy,所以直接用 if rr: 好像會出問題 要把他轉成 list 或是用 if not np.isnan(rr).any() ? 因為 code 還沒完全理解,所以不曉得是我的過程有問題還是code問題