pub enum TrainError {
Config(ConfigError),
Dataset(DatasetError),
Mae(MaeError),
Json(Error),
EmptyDataset,
IndexOutOfBounds {
index: usize,
len: usize,
},
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
TrainingStep(String),
Checkpoint {
message: String,
path: PathBuf,
},
NotImplemented(String),
}Expand description
Top-level error type for the WiFi-DensePose training pipeline.
Orchestration-level functions (e.g. [crate::trainer::Trainer] methods)
return TrainResult<T>. Lower-level functions in crate::config and
crate::dataset return their own module-specific error types which are
automatically coerced into TrainError via From.
Variants§
Config(ConfigError)
A configuration validation or loading error.
Dataset(DatasetError)
A dataset loading or access error.
Mae(MaeError)
A MAE pretraining patchify / masking error (ADR-152 §2.3).
Json(Error)
JSON (de)serialization error.
EmptyDataset
The dataset is empty and no training can be performed.
IndexOutOfBounds
Index out of bounds when accessing dataset items.
ShapeMismatch
A shape mismatch was detected between two tensors.
TrainingStep(String)
A training step failed.
Checkpoint
A checkpoint could not be saved or loaded.
NotImplemented(String)
Feature not yet implemented.
Implementations§
Source§impl TrainError
impl TrainError
Sourcepub fn training_step<S: Into<String>>(msg: S) -> Self
pub fn training_step<S: Into<String>>(msg: S) -> Self
Construct a TrainError::TrainingStep.
Sourcepub fn checkpoint<S: Into<String>>(msg: S, path: impl Into<PathBuf>) -> Self
pub fn checkpoint<S: Into<String>>(msg: S, path: impl Into<PathBuf>) -> Self
Construct a TrainError::Checkpoint.
Sourcepub fn not_implemented<S: Into<String>>(msg: S) -> Self
pub fn not_implemented<S: Into<String>>(msg: S) -> Self
Construct a TrainError::NotImplemented.
Sourcepub fn shape_mismatch(expected: Vec<usize>, actual: Vec<usize>) -> Self
pub fn shape_mismatch(expected: Vec<usize>, actual: Vec<usize>) -> Self
Construct a TrainError::ShapeMismatch.
Trait Implementations§
Source§impl Debug for TrainError
impl Debug for TrainError
Source§impl Display for TrainError
impl Display for TrainError
Source§impl Error for TrainError
impl Error for TrainError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ConfigError> for TrainError
impl From<ConfigError> for TrainError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Source§impl From<DatasetError> for TrainError
impl From<DatasetError> for TrainError
Source§fn from(source: DatasetError) -> Self
fn from(source: DatasetError) -> Self
Source§impl From<Error> for TrainError
impl From<Error> for TrainError
Auto Trait Implementations§
impl !RefUnwindSafe for TrainError
impl !UnwindSafe for TrainError
impl Freeze for TrainError
impl Send for TrainError
impl Sync for TrainError
impl Unpin for TrainError
impl UnsafeUnpin for TrainError
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
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>
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>
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