Open asfansajid123 opened 10 months ago
@asfansajid123 hello ,Has the problem been solved?i`m same problem
Hey @asfansajid123 and @gwkrsrch do you guys found any solution for this. Its been days since i am struggling with this problem.
same problem when using latest transformers version
Running into the same problem here. After retraining on local data and pushing model to Hugging Face, I'm getting this error when pulling it down again for inference. Also, I'm using timm==0.5.4 and transformers==4.25.1, as the latest versions of these packages were throwing errors as well.
Any update here would be most helpful.
@crackthedata use this to install donut-python
pip install git+https://github.com/clovaai/donut.git
@Codedrainer
Yes, that is how I was able to run train.py
locally. After training for 30 epochs using images stored locally, I pushed the model in the result
directory to Hugging Face to https://huggingface.co/Crackingallthedatas/cord-tuned/tree/official so I can use it later.
When I run model = DonutModel.from_pretrained("Crackingallthedatas/cord-tuned")
, I get the above error. I'm using naver-clova-ix/donut-base
as the base model that train.py
pulls from. It seems that train.py
does not output the initial weights present in naver-clova-ix/donut-base
once the training completes.
same problem.how can i solve this?
it seems that HF have some modification on the model, if you want to avoid the error use the model that is official release such as https://huggingface.co/naver-clova-ix/donut-base/tree/official.
The main branch of the model on HF model repo is from HF modification version which will cause problem but if you use the one from official branch, then the problem will be solved.
@gwkrsrch
I am trying to load the pretrained model naver-clova-ix/donut-base-finetuned-cord-v2 but getting the same error every time: Make sure _init_weights is implemented for <class 'donut.model.DonutModel'>"
P.s: I have already tried by cloning the official branch of the repo via huggingface.co
Can you elaborate why this error is persisting or what could have gotten wrong in cloning the official branch? Your input would really mean a lot.![image](https://github.com/clovaai/donut/assets/135522998/2bbfff4f-c5ad-4847-8bb2-90e819032418)