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

Memory error while training #12

Open
hmchuong opened this issue May 6, 2018 · 4 comments
Open

Memory error while training #12

hmchuong opened this issue May 6, 2018 · 4 comments

Comments

@hmchuong
Copy link

hmchuong commented May 6, 2018

I used 2xTeslaK80(12GB each) for training from scratch with batchSize=16 but always got out of memory at the end of the first epoch. Have you trained with the same batchSize on your machine?

@QinyuHu
Copy link

QinyuHu commented May 7, 2018

I feel like it is because of the way he passed loss to scheduler. Instead of only adding values during develop, he added tensor, which accumulated too many memory. You can just unpack the value.
losstensorMean += losstensor
to
losstensorMean += losstensor.data[0]

@hmchuong
Copy link
Author

hmchuong commented May 7, 2018

when we change to that, the losstensorMean and lossVal will receive the same value, isn't it?

@taijizhao
Copy link

@hmchuong hi hmchuong, I trained on 2 1080ti and also met the problem. Meanwhile, the GPU memory usage isn't too high. Did you solve the issue? Thanks!

@yan-michael
Copy link

The problem is still ongoing, any suggestions?? Adding [0] or .item() does not work either, even for batch size of 2.

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

4 participants