question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

forward() got an unexpected keyword argument 'cross_attn_head_mask'

See original GitHub issue
----> 1 paraphrase_t5("Kyle Lowry scored 33 points and Norman Powell added 23 to lift the Toronto Raptors to a 122-125 victory over the Boston Celtics on Wednesday night.")

4 frames
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1049         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1050                 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1051             return forward_call(*input, **kwargs)
   1052         # Do not call functions when jit is used
   1053         full_backward_hooks, non_full_backward_hooks = [], []

TypeError: forward() got an unexpected keyword argument 'cross_attn_head_mask'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
Anku5hkcommented, Jun 24, 2021

I am having the same issue on latest version of transformers(4.8.0), a workaround would be to downgrade transformers to 4.4.2 and it’ll works. But still needs fixing.

2reactions
kagrzecommented, Jun 24, 2021

It’s enough to downgrade to 4.6.1. Version 4.4.2 doesn’t have this patch: https://github.com/huggingface/transformers/pull/10651

Read more comments on GitHub >

github_iconTop Results From Across the Web

forward() got an unexpected keyword argument 'labels' - Stack ...
As far as I know, the BertModel does not take labels in the forward() function. Check out the forward function parameters.
Read more >
forward() got an unexpected keyword argument 'labels ...
When I call: model = BertWithFeats(bert_config, params) I get the error ... TypeError: forward() got an unexpected keyword argument 'labels'.
Read more >
GNNExplainer import - #21 by mufeili - Deep Graph Library
... non_full_backward_hooks = [], [] TypeError: forward() got an unexpected keyword argument 'graph'. Does this also happen to you?
Read more >
TypeError: forward() got an unexpected keyword argument ...
I'm stacked with this model, every day errors came to my code! Anyway I'm trying to implement a Bert Classifier to discriminate between...
Read more >
Forward() got an unexpected keyword argument 'pretrained'
I don't know why I am getting this. I even tried to use fastai.vision.models.resnet34() and I still get the error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found