GabrielDornelles / pytorch-ocr

Simple Pytorch framework to train OCRs. Supports CRNNs, Attention, CTC and Cross Entropy Loss.
MIT License
70 stars 16 forks source link

How to solve? #1

Closed Dreams-ComeTrue closed 1 year ago

Dreams-ComeTrue commented 1 year ago
image

And:Could you please prepare a novice guide for me. I joined GitHub this month, perhaps because of my own interest. I want to study this project. Thank you very much!

GabrielDornelles commented 1 year ago

Hi @Dreams-ComeTrue , thank you for your interest in the project!

I just wrote a Wiki with this guide: https://github.com/GabrielDornelles/pytorch-ocr/wiki

To what I see, your error message looks like you haven't done the Data Setup as the project expects. It's explained in the above link, let me know if you have more questions.

Dreams-ComeTrue commented 1 year ago

Reply

Hi @Dreams-ComeTrue , thank you for your interest in the project!

I just wrote a Wiki with this guide: https://github.com/GabrielDornelles/pytorch-ocr/wiki

To what I see, your error message looks like you haven't done the Data Setup as the project expects. It's explained in the above link, let me know if you have more questions.

Hi@GabrielDornelles ,thank you for your reply! I'm sorry, but I haven't solved the problem after reading your wiki. I want trouble you to solve my questions.Very sorry!

question

Thank you very much for your help,

Sir, your help is of great significance to me and is the driving force for me to learn pytorch-ocr. It is my honor to truly understand the project you wrote. Although it is not worth mentioning in your opinion, it is an opportunity for me to gain interesting knowledge!Thank you again!

Dreams-ComeTrue commented 1 year ago

replenish imageconfig.yaml,two false)

Dreams-ComeTrue commented 1 year ago
image

All directoriesExcuse me is it true?

Dreams-ComeTrue commented 1 year ago

Another question is why my SAVE_ CHECKPOINTS is false?(In config.yaml

Dreams-ComeTrue commented 1 year ago
image
GabrielDornelles commented 1 year ago

I see that your images are PNG file, try to change this line: https://github.com/GabrielDornelles/pytorch-ocr/blob/main/train.py#L49

change it from jpg to png.


The SAVE_ CHECKPOINTS are by default False because it saves the model every epoch, and the model is about 50mb, so if you train for 100 epoches, you'll have 5gb of checkpoints, and that will scale with the number of trainings you do, but if you do want to save the checkpoints you can just set it to True.

Dreams-ComeTrue commented 1 year ago

I see that your images are PNG file, try to change this line: https://github.com/GabrielDornelles/pytorch-ocr/blob/main/train.py#L49

change it from jpg to png.

The SAVE_ CHECKPOINTS are by default False because it saves the model every epoch, and the model is about 50mb, so if you train for 100 epoches, you'll have 5gb of checkpoints, and that will scale with the number of trainings you do, but if you do want to save the checkpoints you can just set it to True.

Thank you. New message appears when rewriting again

image
GabrielDornelles commented 1 year ago

Looks like either you don't have a GPU or you didn't install CUDA drivers, by default the model is set to train on gpu, but you can change it on processing.device, which is set to cuda, put cpu. If you have a NVIDIA GPU, make sure to install the Cuda drivers

Dreams-ComeTrue commented 1 year ago

Looks like either you don't have a GPU or you didn't install CUDA drivers, by default the model is set to train on gpu, but you can change it on processing.device, which is set to cuda, put cpu. If you have a NVIDIA GPU, make sure to install the Cuda drivers

Sorry, could you be more specific?

Dreams-ComeTrue commented 1 year ago
question
Dreams-ComeTrue commented 1 year ago

I didn't use anaconda, I just installed pytorch.

GabrielDornelles commented 1 year ago

You dont have pytorch + GPU support (as you can see in +cpu). To train with GPU you need to install pytorch + cuda support.

Take a look here: https://pytorch.org/get-started/locally/