Vai al contenuto

Riferimento per ultralytics/utils/errors.py

Nota

Questo file è disponibile all'indirizzo https://github.com/ultralytics/ ultralytics/blob/main/ ultralytics/utils/errors .py. Se riscontri un problema, contribuisci a risolverlo inviando una Pull Request 🛠️. Grazie 🙏!



ultralytics.utils.errors.HUBModelError

Basi: Exception

Classe di eccezione personalizzata per gestire gli errori relativi al recupero dei modelli in Ultralytics YOLO .

Questa eccezione viene sollevata quando un modello richiesto non viene trovato o non può essere recuperato. Il messaggio viene anche elaborato per includere le emoji per migliorare l'esperienza dell'utente.

Attributi:

Nome Tipo Descrizione
message str

Il messaggio di errore visualizzato quando viene sollevata l'eccezione.

Nota

Il messaggio viene elaborato automaticamente attraverso la funzione 'emojis' del pacchetto 'ultralytics.utils'.

Codice sorgente in 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.')

Crea un'eccezione per quando un modello non viene trovato.

Codice sorgente in 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))





Creato 2023-11-12, Aggiornato 2024-05-08
Autori: Burhan-Q (1), glenn-jocher (3)