Browse Source

Add non-zero `da` `check_anchor_order()` condition (#7066)

modifyDataloader
Glenn Jocher GitHub 2 years ago
parent
commit
178c109576
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utils/autoanchor.py

+ 1
- 1
utils/autoanchor.py View File

@@ -20,7 +20,7 @@ def check_anchor_order(m):
a = m.anchors.prod(-1).mean(-1).view(-1) # mean anchor area per output layer
da = a[-1] - a[0] # delta a
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')
m.anchors[:] = m.anchors.flip(0)


Loading…
Cancel
Save