Last active
January 13, 2022 16:40
-
-
Save eminorhan/f66f92daa71e424d06f9fb050e364152 to your computer and use it in GitHub Desktop.
delete large memory checkpoint after loading in pytorch
This file contains 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
checkpoint = torch.load(CHECKPOINT_PATH) | |
model.module.load_state_dict(checkpoint['model_state_dict']) | |
del checkpoint | |
torch.cuda.empty_cache() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment