updates
This commit is contained in:
parent
9ffb40b0be
commit
c45cdc4fa3
2
train.py
2
train.py
|
@ -167,7 +167,7 @@ def train(
|
||||||
p.requires_grad = False if epoch == 0 else True
|
p.requires_grad = False if epoch == 0 else True
|
||||||
|
|
||||||
# Update image weights (optional)
|
# Update image weights (optional)
|
||||||
w = model.class_weights.cpu().numpy() * (1 - maps) ** 2 # class weights
|
w = model.class_weights.cpu().numpy() * (1 - maps) # class weights
|
||||||
image_weights = labels_to_image_weights(dataset.labels, nc=nc, class_weights=w)
|
image_weights = labels_to_image_weights(dataset.labels, nc=nc, class_weights=w)
|
||||||
dataset.indices = random.choices(range(dataset.n), weights=image_weights, k=dataset.n) # random weighted index
|
dataset.indices = random.choices(range(dataset.n), weights=image_weights, k=dataset.n) # random weighted index
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue