From 26c52f9485d2a1616d5c53b0eaa50ef5e4f4382b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 30 Oct 2018 15:18:52 +0100 Subject: [PATCH] initialize from darknet53 --- train.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index cbee6a75..3236786d 100644 --- a/train.py +++ b/train.py @@ -72,8 +72,13 @@ def main(opt): best_loss = checkpoint['best_loss'] del checkpoint # current, saved + else: - load_weights(model, 'weights/darknet53.conv.74') # load darknet53 weights (optional) + # Initialize model with darknet53 weights (optional) + if not os.path.isfile('weights/darknet53.conv.74'): + os.system('wget https://pjreddie.com/media/files/darknet53.conv.74 -P /weights') + load_weights(model, 'weights/darknet53.conv.74') + if torch.cuda.device_count() > 1: print('Using ', torch.cuda.device_count(), ' GPUs') model = nn.DataParallel(model)