ultralytics 8.3.56 PaddlePaddle GPU Inference support (#18468)

Co-authored-by: Laughing-q <1185102784@qq.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Jiacong Fang 2024-12-31 20:57:54 +08:00 committed by GitHub
parent 306c5f1d3e
commit 5d8e15800e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license # Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.3.55" __version__ = "8.3.56"
import os import os

View file

@ -603,7 +603,7 @@ class Exporter:
@try_export @try_export
def export_paddle(self, prefix=colorstr("PaddlePaddle:")): def export_paddle(self, prefix=colorstr("PaddlePaddle:")):
"""YOLO Paddle export.""" """YOLO Paddle export."""
check_requirements(("paddlepaddle", "x2paddle")) check_requirements(("paddlepaddle-gpu" if torch.cuda.is_available() else "paddlepaddle", "x2paddle"))
import x2paddle # noqa import x2paddle # noqa
from x2paddle.convert import pytorch2paddle # noqa from x2paddle.convert import pytorch2paddle # noqa

View file

@ -133,7 +133,7 @@ class AutoBackend(nn.Module):
# Set device # Set device
cuda = torch.cuda.is_available() and device.type != "cpu" # use CUDA cuda = torch.cuda.is_available() and device.type != "cpu" # use CUDA
if cuda and not any([nn_module, pt, jit, engine, onnx]): # GPU dataloader formats if cuda and not any([nn_module, pt, jit, engine, onnx, paddle]): # GPU dataloader formats
device = torch.device("cpu") device = torch.device("cpu")
cuda = False cuda = False