Skip to content

Commit

Permalink
train.py GPU memory fix (ultralytics#3590)
Browse files Browse the repository at this point in the history
* train.py GPU memory fix

* ema

* cuda

* cuda

* zeros input

* to device

* batch index 0

(cherry picked from commit 4984cf5)
  • Loading branch information
glenn-jocher authored and Lechtr committed Jun 14, 2021
1 parent ab58994 commit 1a740d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def train(hyp, opt, device, tb_writer=None):
if tb_writer and ni == 0:
with warnings.catch_warnings():
warnings.simplefilter('ignore') # suppress jit trace warning
tb_writer.add_graph(torch.jit.trace(de_parallel(model), imgs, strict=False), []) # graph
tb_writer.add_graph(torch.jit.trace(de_parallel(model), imgs[0:1], strict=False), [])
elif plots and ni == 10 and wandb_logger.wandb:
wandb_logger.log({'Mosaics': [wandb_logger.wandb.Image(str(x), caption=x.name) for x in
save_dir.glob('train*.jpg') if x.exists()]})
Expand Down

0 comments on commit 1a740d5

Please sign in to comment.