allenai / allenai/longformer

TypeError: forward() takes from 2 to 7 positional arguments but 8 were given

未关闭
#215 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
2.2k
派生
286
PR 合并指标
30 天内没有已合并 PR

描述

when I run the model,I got the error below.

Traceback (most recent call last):
File "/Users/scs/Desktop/simbert-master/test_longformer.py", line 41, in
output = model(input_ids, attention_mask=attention_mask)[0]
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/transformers/models/roberta/modeling_roberta.py", line 815, in forward
encoder_outputs = self.encoder(
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/transformers/models/roberta/modeling_roberta.py", line 508, in forward
layer_outputs = layer_module(
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/transformers/models/roberta/modeling_roberta.py", line 395, in forward
self_attention_outputs = self.attention(
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/transformers/models/roberta/modeling_roberta.py", line 323, in forward
self_outputs = self.self(
File "/Users/scs/opt/anaconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
TypeError: forward() takes from 2 to 7 positional arguments but 8 were given

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。