PyTorch-YOLOv3
PyTorch-YOLOv3 copied to clipboard
weight not change, but evaluate Map changed?
for epoch in range(opt.epochs):
model.train()
start_time = time.time()
for batch_i, (_, imgs, targets) in enumerate(dataloader):
batches_done = len(dataloader) * epoch + batch_i
imgs = Variable(imgs.to(device))
targets = Variable(targets.to(device), requires_grad=False)
loss, outputs = model(imgs, targets)
break
loss.backward()
if batches_done % opt.gradient_accumulations:
# Accumulates gradient before each step
optimizer.step()
optimizer.zero_grad()
I add 'break' before loss.backward(), the weight not update, but when I exec evaluate, the Map is change. Could any one can explain it?