clovaai / donut

Official Implementation of OCR-free Document Understanding Transformer (Donut) and Synthetic Document Generator (SynthDoG), ECCV 2022
https://arxiv.org/abs/2111.15664
MIT License
5.52k stars 443 forks source link

getting no module named lightning module when trying to run the fine tuning code in train.py file of donut model. #280

Open svocdfrockz opened 5 months ago

svocdfrockz commented 5 months ago

hi all,

i am getting the following error

WhatsApp Image 2024-01-11 at 19 56 40

when trying to run the code in the below .py file

https://github.com/clovaai/donut/blob/master/train.py

before that let me tell what i did - i created a virtual environment. python version = 3.9. activated environment.

pip install jupyter pip install torch==1.11.0 pip install torchvision==0.12.0 pip install pytorch-lightning == 1.6.4 when i run this i get below error

WhatsApp Image 2024-01-11 at 19 56 40

pip install transformers==411.3 when i run this is also, i get the same error as mentioned previously

however when i use pip show and see the verison i can see that it has be installed and showed the version

lastly i ran this pip install timm==0.5.4.

after environment got created , i opened the lightning module.py file and then installed python and then ran the rest of code in lightining module.py file. post which i ran the code in train.py file

i hope the steps io followed are right however still i get the following error

no module named lightning module when i run the train.py file

can someone please help me here.

felixvor commented 4 months ago

Yes it is probably referring to the lighting_module in the root of this repository: lighting_module.py Make sure you have that file in your working directory (the same directory you run your notebook in) and that you understand the basics of python imports:

https://realpython.com/python-import/ https://saturncloud.io/blog/how-to-import-python-file-as-module-in-jupyter-notebook/