-
Notifications
You must be signed in to change notification settings - Fork 479
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
ERROR FT DONUT-docvqa: TypeError: prepare_inputs_for_inference() got an unexpected keyword argument 'past_key_values' #132
Comments
solved with:
I thought that with |
Pip install is indeed not needed, it's the last transformers version that changed some variables naming. You just need to install transformers version 4.25.1 (pip install transformers==4.25.1) or change input to past_key_values in prepare_inputs_for_inference. |
I get the same error and i am not able to fix it with installing the mentioned packages above. Why is that? I implemented it completly as suggested from source. |
Ok. I just wasted so much time on this so I want to try and lay out a canonical answer so others can avoid the same fate (others probably include future me 🤦 ). Firstly, these requirements are working for me now, with a model I trained with transformers==4.25.1:
Breaking these down:
donut-python <= 1.0.9 (i.e. via pypi / pip install) will introduce:
when using donut-python <= 1.0.9, changing the transformers version will flip you between the _init_weights error for early versions of transformers (#184) and As far as I can tell, no other versions are make or break, but for the sanity of other readers, here's my full requirements.txt:
|
I want to make fine-tuning with the donut-docvqa model, and I have follow the next steps:
For the training I launch the next command:
python train.py --config config/train_docvqa_tests.yaml --pretrained_model_name_or_path "naver-clova-ix/donut-base-finetuned-docvqa" --dataset_name_or_paths '["nielsr/docvqa_1200_examples_donut"]' --exp_version "donut-docvqa-ft-nielsrdocvqa"
config/train_docvqa_tests.yaml:
The execution gives me the next error:
Does anyone know how to fix it?
The text was updated successfully, but these errors were encountered: