Unverified 提交 9b4e0543 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Fix AMP check tolerance (#7937)

Adjust to 5%, fixes failing Colab AMP check with V100 (1.5% different) with 200% safety margin.
上级 cf3fb585
......@@ -520,10 +520,10 @@ def check_amp(model):
LOGGER.warning(emojis(f'{prefix}checks skipped ⚠️, not online.'))
return True
m = AutoShape(model, verbose=False) # model
a = m(im).xyxy[0] # FP32 inference
a = m(im).xywhn[0] # FP32 inference
m.amp = True
b = m(im).xyxy[0] # AMP inference
if (a.shape == b.shape) and torch.allclose(a, b, atol=1.0): # close to 1.0 pixel bounding box
b = m(im).xywhn[0] # AMP inference
if (a.shape == b.shape) and torch.allclose(a, b, atol=0.05): # close to 5% absolute tolerance
LOGGER.info(emojis(f'{prefix}checks passed ✅'))
return True
else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论