Skip to content
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

Gpu memory usage keep increasing #10

Open
longzaitianguo opened this issue Mar 29, 2018 · 5 comments
Open

Gpu memory usage keep increasing #10

longzaitianguo opened this issue Mar 29, 2018 · 5 comments

Comments

@longzaitianguo
Copy link

When I trained the model on my own dataset with 300,000 images, the gpu memory usage kept increasing until it is used up which killed the training process.
I am new to torch. Need your help to figure out this problem @da03

@da03
Copy link
Collaborator

da03 commented Mar 29, 2018

Maybe try a smaller batch size. How much memory does your gpu have?

@longzaitianguo
Copy link
Author

@da03 I used 32 for the batch size. The memory space is 12200MB.
I solved this problem by resizing the image to the same height. Maybe the original images are too large.
By the way, I found your data_gen code didn't resize the image while keeping the original image size.
When I used your original data_gen code, the BLUE score is very low (like 0.1).
After I changed the data_gen code to resize the image to the same height (like what you did in Attetion-ocr), the BLUE score increase to 0.95.
What maybe the reason behind this? Thanks

@da03
Copy link
Collaborator

da03 commented Mar 29, 2018

Are you using the raw images? That could be too large, we are cropping the images such that only the equations are kept (script preprocess_images.py).

@longzaitianguo
Copy link
Author

@da03 Actually we already cropped the images by ourselves, so we did not use the preprocess_images.py.
I wonder why you resize the image to the same height in the 'attention ocr' project while keeping the original size in this project?

@da03
Copy link
Collaborator

da03 commented Mar 30, 2018

Hmm did you subsample the images to make the size X0.5 smaller? We keep the original size because this math dataset contains fractions, integrals and matrices, which has varying heights, while the attention ocr project mainly works on a single word, which has approximately the same height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants