Simplify check_requirements() usage (#4855)

* Simplify `check_requirements()` usage

* remove assert, print()
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-09-18 18:34:30 +02:00
1 parent 4d1a2ac87e
commit 4c839eeb10
6 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -127,7 +127,7 @@ def kmean_anchors(dataset='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen
print(f'{prefix}Running kmeans for {n} anchors on {len(wh)} points...')
s = wh.std(0) # sigmas for whitening
k, dist = kmeans(wh / s, n, iter=30) # points, mean distance
assert len(k) == n, print(f'{prefix}ERROR: scipy.cluster.vq.kmeans requested {n} points but returned only {len(k)}')
assert len(k) == n, f'{prefix}ERROR: scipy.cluster.vq.kmeans requested {n} points but returned only {len(k)}'
k *= s
wh = torch.tensor(wh, dtype=torch.float32) # filtered
wh0 = torch.tensor(wh0, dtype=torch.float32) # unfiltered