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

How to fix the CUDA out of memory error when using Multi-Step Loss Optimization (MSL)? #25

Open
machanic opened this issue Nov 14, 2019 · 1 comment

Comments

@machanic
Copy link

Dear author:
when I ran your code I found that
https://github.com/AntreasAntoniou/HowToTrainYourMAMLPytorch/blob/master/few_shot_learning_system.py#L196
This line will cause the OOM error because each time the gradient of loss backprop w.r.t. the whole network's parameters will be recorded. And such gradient will not be freed util all the mini-batch's multi-tasks loop over.

I use 11Gb 1080Ti to run CIFAR-10 dataset, but it report CUDA out of memory error.
How to deal and fix it?

@pandeydeep9
Copy link
Contributor

pandeydeep9 commented Feb 7, 2021

Maybe this could help: reduce the batch size or the number of inner loop updates from 5 to say 2 or 3.

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