ベース: Exception
Ultralytics YOLO のモデル取得に関連するエラーを処理するためのカスタム例外クラス。
この例外は、要求されたモデルが見つからないか、取得できない場合に発生します。
メッセージはまた、より良いユーザ体験のために絵文字を含むように処理されます。
属性:
注
メッセージは、'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))
|