Skip to content

Commit 5170cd3

Browse files
committed
updates
1 parent d79a54a commit 5170cd3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

train.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ def train(
4040

4141
# Initialize model
4242
model = Darknet(cfg, img_size).to(device)
43-
# for m in model.modules():
44-
# weights_init_normal(m) # set weight distributions
4543

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

0 commit comments

Comments
 (0)