From 47400aa066628eed6aa4e1b8f35908ca667030d3 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 2 Apr 2019 14:29:35 +0200 Subject: [PATCH] updates --- train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index 589a9f7b..d8394311 100644 --- a/train.py +++ b/train.py @@ -53,7 +53,7 @@ def train( if checkpoint['optimizer'] is not None: optimizer.load_state_dict(checkpoint['optimizer']) best_loss = checkpoint['best_loss'] - del checkpoint # current, saved + del checkpoint else: # Initialize model with backbone (optional) if cfg.endswith('yolov3.cfg'): @@ -180,6 +180,7 @@ def train( model) is nn.parallel.DistributedDataParallel else model.state_dict(), 'optimizer': optimizer.state_dict()} torch.save(checkpoint, latest) + del checkpoint # Save best checkpoint if best_loss == mloss['total']: