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

forward() got an unexpected keyword argument 'lm_labels' #2

Closed
yhshu opened this issue Mar 4, 2021 · 2 comments
Closed

forward() got an unexpected keyword argument 'lm_labels' #2

yhshu opened this issue Mar 4, 2021 · 2 comments

Comments

@yhshu
Copy link

yhshu commented Mar 4, 2021


2021-03-04 13:59:21,045 INFO     Checking...
2021-03-04 13:59:21,045 INFO     ===================Dev==================
Traceback (most recent call last):
  File "/home/home1/yhshu/.conda/envs/pytorch16/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/home1/yhshu/.conda/envs/pytorch16/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/home1/yhshu/workspace/FusionQA/KQAPro_Baselines-master/Bart_SPARQL/train.py", line 200, in <module>
    main()
  File "/home/home1/yhshu/workspace/FusionQA/KQAPro_Baselines-master/Bart_SPARQL/train.py", line 196, in main
    train(args)
  File "/home/home1/yhshu/workspace/FusionQA/KQAPro_Baselines-master/Bart_SPARQL/train.py", line 112, in train
    outputs = model(**inputs)
  File "/home/home1/yhshu/.conda/envs/pytorch16/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'lm_labels'

I think KQA Pro is a very good work.
However, I ran into some problems while running the experiments.
The repository does not describe how to import BART models, and I directly used facebook/bart-base as the model name and encountered the problem above.

@ShulinCao
Copy link
Collaborator

The problem is caused by transformer version. Maybe you can change 'lm_labels' to 'labels'.

@yhshu
Copy link
Author

yhshu commented Mar 4, 2021

Thanks for your advice. It works now.

@yhshu yhshu closed this as completed Mar 4, 2021
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