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() missing 2 required positional arguments: 'input' and 'attn_text' #7

Open
Agiroy4712 opened this issue Oct 8, 2021 · 0 comments

Comments

@Agiroy4712
Copy link

hello~, i'm, try to run the demo.py but I got this error. And another problem is that is always use all the gpus even though i set the gpu_num.
thank for reply !!
Traceback (most recent call last): File "demo.py", line 137, in <module> demo(opt) File "demo.py", line 55, in demo predss = model(image, text_for_pred, is_train=False)[0] File "/home/liaohaiqing/anaconda3/envs/text/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/liaohaiqing/anaconda3/envs/text/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 161, in forward outputs = self.parallel_apply(replicas, inputs, kwargs) File "/home/liaohaiqing/anaconda3/envs/text/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 171, in parallel_apply return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)]) File "/home/liaohaiqing/anaconda3/envs/text/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 86, in parallel_apply output.reraise() File "/home/liaohaiqing/anaconda3/envs/text/lib/python3.7/site-packages/torch/_utils.py", line 428, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in replica 4 on device 4. Original Traceback (most recent call last): File "/home/liaohaiqing/anaconda3/envs/text/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 61, in _worker output = module(*input, **kwargs) File "/home/liaohaiqing/anaconda3/envs/text/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) TypeError: forward() missing 2 required positional arguments: 'input' and 'attn_text'

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

1 participant