From c466b9c1ff6cc86813972b7d63b1724d2e33a29a Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Mon, 9 Dec 2019 13:34:17 +0100 Subject: [PATCH] fix memory bloat on restore --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 0c3cff0..8aa0567 100644 --- a/train.py +++ b/train.py @@ -569,7 +569,7 @@ def main(args): # pylint: disable=redefined-outer-name pos_weight=torch.tensor(10)) if c.stopnet else None if args.restore_path: - checkpoint = torch.load(args.restore_path) + checkpoint = torch.load(args.restore_path, map_location='cpu') try: # TODO: fix optimizer init, model.cuda() needs to be called before # optimizer restore