2021-09-19 20:23:44:INFO: ***** Running dev *****
2021-09-19 20:23:44:INFO: Num examples = 271
2021-09-19 20:23:44:INFO: Batch size = 16
dev: 0%| | 0/17 [00:02<?, ?it/s]
Traceback (most recent call last):
File "/root/python_proj/LEBERT/Trainer.py", line 601, in <module>
main()
File "/root/python_proj/LEBERT/Trainer.py", line 584, in main
eval_output, _ = evaluate(model, args, dev_dataset, label_vocab, global_steps, "dev", write_file=True)
File "/root/python_proj/LEBERT/Trainer.py", line 444, in evaluate
outputs = model(**inputs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/python_proj/LEBERT/wcbert_modeling.py", line 498, in forward
outputs = self.bert(
File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/python_proj/LEBERT/wcbert_modeling.py", line 463, in forward
hidden_states=encoder_outputs.hidden_states,
AttributeError: 'tuple' object has no attribute 'hidden_states'
Process finished with exit code 1
运行代码报tuple中没有hidden_states, 我的transformers版本是4.10.2,难道是transformers版本的问题?