Add non-zero `da` `check_anchor_order()` condition (#7066)
This commit is contained in:
parent
9e75cbf4c1
commit
178c109576
|
|
@ -20,7 +20,7 @@ def check_anchor_order(m):
|
||||||
a = m.anchors.prod(-1).mean(-1).view(-1) # mean anchor area per output layer
|
a = m.anchors.prod(-1).mean(-1).view(-1) # mean anchor area per output layer
|
||||||
da = a[-1] - a[0] # delta a
|
da = a[-1] - a[0] # delta a
|
||||||
ds = m.stride[-1] - m.stride[0] # delta s
|
ds = m.stride[-1] - m.stride[0] # delta s
|
||||||
if da.sign() != ds.sign(): # same order
|
if da and (da.sign() != ds.sign()): # same order
|
||||||
LOGGER.info(f'{PREFIX}Reversing anchor order')
|
LOGGER.info(f'{PREFIX}Reversing anchor order')
|
||||||
m.anchors[:] = m.anchors.flip(0)
|
m.anchors[:] = m.anchors.flip(0)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue