Skip to main content
YOLO object doesn't take device option https://docs.ultralytics.com/reference/yolo/engine/model/#ultralytics.yolo.engine.model.YOLO , so only model.to('cuda') is the right statement and then it works.
Source Link

In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:

model = YOLO("yolov8n.pt", device='gpu') 
model.to('cuda')

some useful docs here

You can also explicitly run a prediction and specify the device. See docs here

model.predict(source, save=True, imgsz=320, conf=0.5,device='xyz')

In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:

model = YOLO("yolov8n.pt", device='gpu') 
model.to('cuda')

some useful docs here

You can also explicitly run a prediction and specify the device. See docs here

model.predict(source, save=True, imgsz=320, conf=0.5,device='xyz')

In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:

model = YOLO("yolov8n.pt") 
model.to('cuda')

some useful docs here

You can also explicitly run a prediction and specify the device. See docs here

model.predict(source, save=True, imgsz=320, conf=0.5,device='xyz')
added 233 characters in body
Source Link
219CID
  • 480
  • 1
  • 10
  • 32

In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:

model = YOLO("yolov8n.pt", device='gpu') 
model.to('cuda')

some useful docs here

You can also explicitly run a prediction and specify the device. See docs here

model.predict(source, save=True, imgsz=320, conf=0.5,device='xyz')

In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:

model = YOLO("yolov8n.pt", device='gpu') 
model.to('cuda')

some useful docs here

In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:

model = YOLO("yolov8n.pt", device='gpu') 
model.to('cuda')

some useful docs here

You can also explicitly run a prediction and specify the device. See docs here

model.predict(source, save=True, imgsz=320, conf=0.5,device='xyz')
Source Link
219CID
  • 480
  • 1
  • 10
  • 32

In order to move a YOLO model to GPU you must use the pytorch .to syntax like so:

model = YOLO("yolov8n.pt", device='gpu') 
model.to('cuda')

some useful docs here