#[non_exhaustive]pub enum ModelConfigError {
Io {
path: PathBuf,
source: Error,
},
Container(String),
InvalidField {
file: String,
field: String,
reason: String,
},
NotSupported {
field: String,
reason: String,
},
UnsupportedArchitecture(String),
Override(String),
LabelCountMismatch {
expected: usize,
found: usize,
},
Unresolved {
missing: String,
overrides: String,
},
Infer(InferError),
Schema(DecoderError),
}Expand description
Why a model configuration could not be read or resolved.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io
A file could not be read.
Container(String)
A model container is malformed where its metadata is stored.
InvalidField
A recognised configuration file has a malformed field.
Fields
NotSupported
A recognised field asks for something the HAL cannot do.
UnsupportedArchitecture(String)
A Hugging Face architecture with no decoder mapping, named by its
model_type.
Override(String)
An override is malformed or cannot apply to this model.
LabelCountMismatch
The labels override names a different number of classes than the
model has.
Unresolved
Nothing supplied a required piece of the configuration.
Fields
Infer(InferError)
Ultralytics metadata was found but could not be interpreted.
Schema(DecoderError)
A configuration was found but is not a valid schema.
Trait Implementations§
Source§impl Debug for ModelConfigError
impl Debug for ModelConfigError
Source§impl Display for ModelConfigError
impl Display for ModelConfigError
Source§impl Error for ModelConfigError
impl Error for ModelConfigError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<DecoderError> for ModelConfigError
impl From<DecoderError> for ModelConfigError
Source§fn from(e: DecoderError) -> Self
fn from(e: DecoderError) -> Self
Converts to this type from the input type.
Source§impl From<InferError> for ModelConfigError
impl From<InferError> for ModelConfigError
Source§fn from(e: InferError) -> Self
fn from(e: InferError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ModelConfigError
impl !UnwindSafe for ModelConfigError
impl Freeze for ModelConfigError
impl Send for ModelConfigError
impl Sync for ModelConfigError
impl Unpin for ModelConfigError
impl UnsafeUnpin for ModelConfigError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more