donut icon indicating copy to clipboard operation
donut copied to clipboard

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

Open svocdfrockz opened this issue 1 year ago • 1 comments

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.

svocdfrockz avatar Jan 11 '24 15:01 svocdfrockz

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/

felixvor avatar Feb 21 '24 10:02 felixvor