Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Apr 3, 2019
1 parent d79a54a commit 5170cd3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def train(

# Initialize model
model = Darknet(cfg, img_size).to(device)
# for m in model.modules():
# weights_init_normal(m) # set weight distributions

# Optimizer
lr0 = 0.001 # initial learning rate
Expand All @@ -56,7 +54,7 @@ def train(
if resume: # Load previously saved model
if transfer: # Transfer learning
chkpt = torch.load(weights + 'yolov3.pt', map_location=device)
model.load_state_dict({k: v for k, v in chkpt['model'].items() if v.numel() > 1 and v.shape[0] != nf},
model.load_state_dict({k: v for k, v in chkpt['model'].items() if v.numel() > 1 and v.shape[0] != 255},
strict=False)
for p in model.parameters():
p.requires_grad = True if p.shape[0] == nf else False
Expand Down

0 comments on commit 5170cd3

Please sign in to comment.