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

Skip AMP check on MPS (#9189)

上级 13530402
...@@ -535,8 +535,8 @@ def check_amp(model): ...@@ -535,8 +535,8 @@ def check_amp(model):
prefix = colorstr('AMP: ') prefix = colorstr('AMP: ')
device = next(model.parameters()).device # get model device device = next(model.parameters()).device # get model device
if device.type == 'cpu': if device.type in ('cpu', 'mps'):
return False # AMP disabled on CPU return False # AMP only used on CUDA devices
f = ROOT / 'data' / 'images' / 'bus.jpg' # image to check f = ROOT / 'data' / 'images' / 'bus.jpg' # image to check
im = f if f.exists() else 'https://ultralytics.com/images/bus.jpg' if check_online() else np.ones((640, 640, 3)) im = f if f.exists() else 'https://ultralytics.com/images/bus.jpg' if check_online() else np.ones((640, 640, 3))
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论