Entdecken Sie PyTorch, das flexible, Python Framework für maschinelles Lernen, das KI-Innovationen wie Ultralytics YOLO ermöglicht. Entwickeln Sie noch heute intelligenter und schneller!
PyTorch is an open-source machine learning library primarily developed by Meta AI that has become a cornerstone for researchers and developers in the field of deep learning. Known for its flexibility and ease of use, it allows users to build and train complex neural networks using a dynamic computational graph. This feature, often referred to as "eager execution," enables code to be evaluated immediately, making debugging and prototyping significantly more intuitive compared to frameworks that rely on static graph definitions. It integrates seamlessly with the Python programming language, feeling like a natural extension of standard scientific computing tools.
At the heart of this framework are tensors, which are multi-dimensional arrays similar to those found in the NumPy documentation. However, unlike standard arrays, PyTorch tensors are designed to leverage GPU acceleration provided by NVIDIA CUDA. This hardware acceleration is critical for the massive parallel processing required to train modern artificial intelligence (AI) models efficiently.
The library supports a vast ecosystem of tools for computer vision (CV) and natural language processing. By providing a rich set of pre-built layers, optimizers, and loss functions, it simplifies the process of creating algorithms for tasks like image classification and sequence modeling.
Die Vielseitigkeit dieses Frameworks hat dazu geführt, dass es in verschiedenen Branchen für hochwirksame KI-Lösungen eingesetzt wird:
Um seine Rolle besser zu verstehen, ist es hilfreich, PyTorch anderen gängigen Tools im KI-Stack zu unterscheiden:
Die gesamte Ultralytics , einschließlich des hochmodernen YOLO26 und des weit verbreiteten YOLO11, basiert nativ auf PyTorch. Diese Grundlage stellt sicher, dass Anwender von der Geschwindigkeit, Stabilität und dem umfangreichen Community-Support des Frameworks profitieren. Ob beim Transfer-Lernen mit benutzerdefinierten Trainingsdaten oder beim Exportieren von Modellen für Edge-Geräte – die zugrundeliegende Architektur basiert auf PyTorch und -Gradienten.
Die kommende Ultralytics vereinfacht diese Erfahrung weiter und bietet eine einheitliche Schnittstelle zur Verwaltung der Beschaffung, Schulung und Bereitstellung von Datensätzen, ohne dass umfangreicher Boilerplate-Code geschrieben werden muss.
Das folgende Beispiel zeigt, wie man GPU überprüft und eine Inferenz mit einem YOLO durchführt, und veranschaulicht, wie das Framework die Hardwarebeschleunigung im Hintergrund handhabt:
import torch
from ultralytics import YOLO
# Check if CUDA (GPU) is available for PyTorch acceleration
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"PyTorch is using device: {device}")
# Load a YOLO26n model (built on PyTorch)
model = YOLO("yolo26n.pt")
# Perform object detection on an image
# PyTorch handles tensor operations and moves data to the GPU automatically
results = model("https://ultralytics.com/images/bus.jpg", device=device)