垒球 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))
|