TypeError: forward() takes from 2 to 7 positional arguments but 8 were given
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 285
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.