Skip to content

Commit

Permalink
Explicitly delete device-converted tensors.
Browse files Browse the repository at this point in the history
Fixes dotchen#4.
  • Loading branch information
tomcur committed Apr 17, 2020
1 parent c5422a5 commit 14daa4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions training/train_birdview.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def train_or_eval(criterion, net, data, optim, is_train, config, is_first_epoch)

tick = time.time()

del birdview, location, command, speed
del pred_location, loss, loss_mean

if is_first_epoch and i == 10:
iterator_tqdm.close()
break
Expand Down
3 changes: 3 additions & 0 deletions training/train_image_phase0.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ def train_or_eval(coord_converter, criterion, net, teacher_net, data, optim, is_

tick = time.time()

del rgb_image, birdview, location, command, speed
del _teac_location, _pred_location, pred_location, teac_location, loss, loss_mean

if is_first_epoch and i == 10:
iterator_tqdm.close()
break
Expand Down
4 changes: 4 additions & 0 deletions training/train_image_phase1.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ def train_or_eval(coord_converter, criterion, net, teacher_net, data, optim, is_

tick = time.time()

del rgb_image, birdview, location, command, speed
del _teac_location, _teac_locations, _pred_location, _pred_locations, pred_location, pred_locations
del loss, loss_mean

if is_first_epoch and i == 10:
iterator_tqdm.close()
break
Expand Down

0 comments on commit 14daa4a

Please sign in to comment.