コンテンツへスキップ

参考 ultralytics/utils/errors.py

このファイルはhttps://github.com/ultralytics/ultralytics/blob/main/ ultralytics/utils/errors .py にあります。もし問題を発見したら、Pull Request🛠️ を投稿して修正にご協力ください。ありがとうございました!



ultralytics.utils.errors.HUBModelError

ベース: Exception

Ultralytics YOLO のモデル取得に関連するエラーを処理するためのカスタム例外クラス。

この例外は、要求されたモデルが見つからないか、取得できない場合に発生します。 メッセージはまた、より良いユーザ体験のために絵文字を含むように処理されます。

属性:

名称 タイプ 説明
message str

例外が発生したときに表示されるエラーメッセージ。

メッセージは、'ultralytics.utils'パッケージの'emojis'関数によって自動的に処理される。

ソースコード 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
著者Burhan-Q(1),glenn-jocher(3)