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

RAG finetuning - unexpected keyword argument 'early_stop_callback' #7782

Closed
ioannist opened this issue Oct 14, 2020 · 2 comments
Closed

RAG finetuning - unexpected keyword argument 'early_stop_callback' #7782

ioannist opened this issue Oct 14, 2020 · 2 comments

Comments

@ioannist
Copy link

Environment info

transformers version: 3.3.1
Platform: Ubuntu
Python version:3.6.12
PyTorch version (GPU: yes): 1.6.0
Using GPU in script?: 1 gpu
Using distributed or parallel set-up in script?: no

Who can help

@patrickvonplaten @sgugger

Information

model name: facebook/rag-token-base

The problem arises when using:

  • [x ] the official example scripts: (give details below)

The tasks I am working on is:

  • [x ] my own task or dataset: (give details below)

To reproduce

Call finetune ona rag model
python examples/rag/finetune.py --data_dir=$(pwd)/examples/rag/ioannis-data --output_dir $(pwd)/examples/rag/ioannis-output --model_name_or_path=facebook/rag-token-base --model_type rag_sequence --fp16 --gpus 1

Traceback (most recent call last):
  File "examples/rag/finetune.py", line 469, in <module>
    main(args)
  File "examples/rag/finetune.py", line 442, in main
    logger=logger,
  File "/home/ioannis/Desktop/transformers/examples/lightning_base.py", line 379, in generic_train
    **train_params,
  File "/home/ioannis/anaconda3/envs/transformers/lib/python3.6/site-packages/pytorch_lightning/trainer/properties.py", line 122, in from_argparse_args
    return argparse_utils.from_argparse_args(cls, args, **kwargs)
  File "/home/ioannis/anaconda3/envs/transformers/lib/python3.6/site-packages/pytorch_lightning/utilities/argparse_utils.py", line 50, in from_argparse_args
    return cls(**trainer_kwargs)
  File "/home/ioannis/anaconda3/envs/transformers/lib/python3.6/site-packages/pytorch_lightning/trainer/connectors/env_vars_connector.py", line 41, in overwrite_by_env_vars
    return fn(self, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'early_stop_callback'

I noticed a variable named early_stopping_callback in finetune.py. A typo perhaps?

@ioannist ioannist changed the title RAG fientuning - unexpected keyword argument 'early_stop_callback' RAG finetuning - unexpected keyword argument 'early_stop_callback' Oct 14, 2020
@bharathc346
Copy link

bharathc346 commented Oct 14, 2020

If you don't need early stopping just comment out early_stop_callback=early_stopping_callback on line 379 of /home/ioannis/Desktop/transformers/examples/lightning_base.py. You should be able to run your script.

I think lightning may have changed their api
You can also just uninstall your pytorch lightning and do pip install pytorch_lightning==0.9.0 and script should work

@ioannist
Copy link
Author

ioannist commented Oct 15, 2020

Awesome! Installing 0.9.0 worked.

I manually installed pytorch_lightning and gitpython as they were not included in the transformers installation and the rag requirements file.

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