Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: forward() takes 2 positional arguments but 3 were given #13

Open
fionathrill opened this issue Jan 23, 2023 · 1 comment
Open

Comments

@fionathrill
Copy link

Anyone else encountering this issue with pytorch?

TypeError: forward() takes 2 positional arguments but 3 were given

TypeError                                 Traceback (most recent call last)
<command-1272036722344615> in <cell line: 52>()
     50 images = torch.randn(4, 2, 3, 256, 256)
     51 
---> 52 flamingo_logits = flamingo_palm(dialogue, images)
     53 
     54 # do your usual cross entropy loss

/databricks/python/lib/python3.9/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1128         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1129                 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130             return forward_call(*input, **kwargs)
@tawsif67
Copy link

To fix this error, you need to pass in dialogue as the text argument and images as a keyword argument, like this:
flamingo_logits = flamingo_palm(text=dialogue, images=images)
Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants