انتقل إلى المحتوى

مرجع ل ultralytics/utils/errors.py

ملاحظه

هذا الملف متاح في https://github.com/ultralytics/ultralytics/ نقطة / الرئيسية /ultralytics/ المرافق / errors.py. إذا اكتشفت مشكلة ، فيرجى المساعدة في إصلاحها من خلال المساهمة في طلب 🛠️ سحب. شكرا لك 🙏!



ultralytics.utils.errors.HUBModelError

قواعد: Exception

فئة استثناء مخصصة لمعالجة الأخطاء المتعلقة بجلب النموذج Ultralytics YOLO.

يتم رفع هذا الاستثناء عند عدم العثور على نموذج مطلوب أو تعذر استرداده. تتم معالجة الرسالة أيضا لتضمين الرموز التعبيرية للحصول على تجربة مستخدم أفضل.

سمات:

اسم نوع وصف
message str

تظهر رسالة الخطأ عند رفع الاستثناء.

ملاحظه

تتم معالجة الرسالة تلقائيا من خلال وظيفة "الرموز التعبيرية" من "ultralyticsحزمة .utils.

شفرة المصدر في ultralytics/utils/errors.py
class HUBModelError(Exception):
    """
    Custom exception class for handling errors related to model fetching in Ultralytics YOLO.

    This exception is raised when a requested model is not found or cannot be retrieved.
    The message is also processed to include emojis for better user experience.

    Attributes:
        message (str): The error message displayed when the exception is raised.

    Note:
        The message is automatically processed through the 'emojis' function from the 'ultralytics.utils' package.
    """

    def __init__(self, message="Model not found. Please check model URL and try again."):
        """Create an exception for when a model is not found."""
        super().__init__(emojis(message))

__init__(message='Model not found. Please check model URL and try again.')

إنشاء استثناء عندما لا يتم العثور على نموذج.

شفرة المصدر في ultralytics/utils/errors.py
def __init__(self, message="Model not found. Please check model URL and try again."):
    """Create an exception for when a model is not found."""
    super().__init__(emojis(message))





تم الإنشاء 2023-11-12، تم التحديث 2024-05-08
المؤلفون: برهان-Q (1)، جلين-جوتشر (3)