pub enum TrainError {
Config(ConfigError),
Dataset(DatasetError),
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.
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.