mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
Skip AMP check on MPS (#9189)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
13530402f8
commit
e57275a2d8
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user