fix memory bloat on restore

This commit is contained in:
Eren Golge 2019-12-09 13:34:17 +01:00
parent 40a533530b
commit c466b9c1ff
1 changed files with 1 additions and 1 deletions

View File

@ -569,7 +569,7 @@ def main(args): # pylint: disable=redefined-outer-name
pos_weight=torch.tensor(10)) if c.stopnet else None pos_weight=torch.tensor(10)) if c.stopnet else None
if args.restore_path: if args.restore_path:
checkpoint = torch.load(args.restore_path) checkpoint = torch.load(args.restore_path, map_location='cpu')
try: try:
# TODO: fix optimizer init, model.cuda() needs to be called before # TODO: fix optimizer init, model.cuda() needs to be called before
# optimizer restore # optimizer restore