remove unused variable in def compute_loss function (#1659)

remove unused variable in def compute_loss function
This commit is contained in:
Yonghye Kwon 2021-01-14 02:13:13 +09:00 committed by GitHub
parent 166a4d590f
commit bc69220782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,7 +104,6 @@ def compute_loss(p, targets, model): # predictions, targets, model
BCEcls, BCEobj = FocalLoss(BCEcls, g), FocalLoss(BCEobj, g)
# Losses
nt = 0 # number of targets
balance = [4.0, 1.0, 0.4, 0.1] # P3-P6
for i, pi in enumerate(p): # layer index, layer predictions
b, a, gj, gi = indices[i] # image, anchor, gridy, gridx
@ -112,7 +111,6 @@ def compute_loss(p, targets, model): # predictions, targets, model
n = b.shape[0] # number of targets
if n:
nt += n # cumulative targets
ps = pi[b, a, gj, gi] # prediction subset corresponding to targets
# Regression