这个bug发生于写BERT的在线inference代码。错误如下:
Traceback (most recent call last):
File "classifier.py", line 94, in <module>
result = clf.predict(content)
File "classifier.py", line 77, in predict
outputs = self.model(ids, mask, token_type_ids)
File "/data/angchen/env/torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "../src/bert.py", line 29, in forward
_, output_1 = self.l1(ids, attention_mask = mask, token_type_ids=token_type_ids)
File "/data/angchen/env/torch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/data/angchen/env/torch/lib/python3.6/site-packages/transformers/models/bert/modeling_bert.py", line 950, in forward
batch_size, seq_length = input_shape
ValueError: not enough values to unpac