Bỏ để qua phần nội dung

Tài liệu tham khảo cho ultralytics/utils/errors.py

Ghi

Tệp này có sẵn tại https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/errors.py. Nếu bạn phát hiện ra một vấn đề, vui lòng giúp khắc phục nó bằng cách đóng góp Yêu cầu 🛠️ kéo. Cảm ơn bạn 🙏 !



ultralytics.utils.errors.HUBModelError

Căn cứ: Exception

Lớp ngoại lệ tùy chỉnh để xử lý các lỗi liên quan đến tìm nạp mô hình trong Ultralytics YOLO.

Ngoại lệ này được đưa ra khi không tìm thấy mô hình được yêu cầu hoặc không thể truy xuất được. Tin nhắn cũng được xử lý để bao gồm biểu tượng cảm xúc để có trải nghiệm người dùng tốt hơn.

Thuộc tính:

Tên Kiểu Sự miêu tả
message str

Thông báo lỗi hiển thị khi ngoại lệ được nêu ra.

Ghi

Tin nhắn được tự động xử lý thông qua chức năng 'biểu tượng cảm xúc' từ 'ultralyticsGói .utils.

Mã nguồn trong 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.')

Tạo ngoại lệ khi không tìm thấy mô hình.

Mã nguồn trong 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))





Đã tạo 2023-11-12, Cập nhật 2024-05-08
Tác giả: Burhan-Q (1), glenn-jocher (3)