์ฝ˜ํ…์ธ ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

์ฐธ์กฐ ultralytics/utils/errors.py

์ฐธ๊ณ 

์ด ํŒŒ์ผ์€ https://github.com/ultralytics/ ultralytics/blob/main/ ultralytics/utils/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
์ž‘์„ฑ์ž: Burhan-Q (1), ๊ธ€๋ Œ ์กฐ์ฒ˜ (3)