Last active
November 14, 2019 16:55
-
-
Save shubhamagarwal92/8ecf839cf70c4990e3540d0bb4f288ff to your computer and use it in GitHub Desktop.
Pytorch issue allocating memory on gpu0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to https://github.com/andreavanzo for figuring this out | |
# device should be integer here and not torch.device | |
# do | |
torch.cuda.set_device(device) | |
# before | |
torch.cuda.empty_cache() | |
# Also do empty cache after every epoch | |
# Detach vs no grad | |
# https://discuss.pytorch.org/t/detach-no-grad-and-requires-grad/16915/8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment