قم بتحسين نماذج التعلم العميق باستخدام TensorRT للحصول على استدلال أسرع وفعال على وحدات معالجة الرسومات NVIDIA . تحقيق أداء في الوقت الفعلي مع YOLO وتطبيقات الذكاء الاصطناعي.
TensorRT is a high-performance deep learning inference software development kit (SDK) developed by NVIDIA. It is designed to optimize neural network models for deployment, delivering low inference latency and high throughput for deep learning applications. By acting as an optimization compiler, TensorRT takes trained networks from popular frameworks like PyTorch and TensorFlow and restructures them to execute efficiently on NVIDIA GPUs. This capability is crucial for running complex AI models in production environments where speed and efficiency are paramount.
The core function of TensorRT is to convert a trained neural network into an optimized "engine" specifically tuned for the target hardware. It achieves this through several advanced techniques:
نظرًا لقدرته على معالجة كميات هائلة من البيانات بأقل تأخير ممكن، TensorRT استخدام TensorRT على نطاق واسع في الصناعات التي تعتمد على الرؤية الحاسوبية ومهام الذكاء الاصطناعي المعقدة حيث يعد التوقيت أمرًا بالغ الأهمية.
يُعد دمج TensorRT في سير عملك أمراً سهلاً ومباشراً باستخدام أدوات الذكاء الاصطناعي الحديثة. إن ultralytics package
provides a seamless method to convert standard PyTorch models into TensorRT engines. This allows users to leverage the
state-of-the-art architecture of Ultralytics YOLO26 with the
hardware acceleration of NVIDIA GPUs. For teams looking to manage their datasets and training pipelines before export,
the منصة Ultralytics offers a comprehensive environment to prepare
models for such high-performance deployment.
يوضح المثال التالي كيفية تصدير نموذج YOLO26 إلى ملف TensorRT (.engine) و
استخدمه لـ الاستدلال في الوقت الحقيقي:
from ultralytics import YOLO
# Load the latest stable YOLO26 model (nano size)
model = YOLO("yolo26n.pt")
# Export the model to TensorRT format (creates 'yolo26n.engine')
# This step optimizes the computational graph for your specific GPU
model.export(format="engine")
# Load the optimized TensorRT engine for high-speed inference
trt_model = YOLO("yolo26n.engine")
# Run inference on an image source
results = trt_model("https://ultralytics.com/images/bus.jpg")
It is important to distinguish TensorRT from other terms often heard in the model deployment landscape:
For developers aiming to maximize the performance of their AI agents or vision systems, understanding the transition from a training framework to an optimized runtime like TensorRT is a key step in professional MLOps.