From d661fba8ae27b2c08b3ccc804099dc75beeadb93 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 21 Mar 2019 11:48:50 +0200 Subject: [PATCH] updates --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index b791d7e4..306a8c64 100644 --- a/train.py +++ b/train.py @@ -70,7 +70,7 @@ def train( cutoff = load_darknet_weights(model, weights + 'yolov3-tiny.conv.15') # Set optimizer - optimizer = torch.optim.SGD(model.parameters(), lr=lr0, momentum=.9) + optimizer = torch.optim.SGD(filter(lambda x: x.requires_grad, model.parameters()), lr=lr0, momentum=.9) if torch.cuda.device_count() > 1: model = nn.DataParallel(model)