pub enum Error {
Show 15 variants
LoadFailed {
source: Error,
paths: Vec<String>,
},
SymbolNotFound {
name: &'static str,
source: Error,
},
ModelLoadFailed {
path: PathBuf,
},
InvalidPath(NulError),
InvalidOption(NulError),
InterpreterCreateFailed,
AllocateTensorsFailed,
InvokeFailed {
status: TfLiteStatus,
},
TensorIndexOutOfBounds {
index: usize,
count: usize,
},
DtypeMismatch {
expected: TfLiteType,
actual: TfLiteType,
},
NullTensor,
NullData,
DelegateCreateFailed,
DelegateOptionRejected {
status: TfLiteStatus,
},
ExternalDelegateApiUnavailable,
}Expand description
Errors that can arise while loading the TensorFlow Lite shared library, building an interpreter, or operating on tensors.
Variants§
LoadFailed
None of the candidate shared-library paths could be opened.
The paths list records every probe attempt in order. The source
contains the last underlying libloading failure, which is usually
the most informative.
Fields
SymbolNotFound
The shared library opened but a required exported symbol was missing.
Fields
ModelLoadFailed
TfLiteModelCreateFromFile returned NULL for the given path.
InvalidPath(NulError)
A filesystem path could not be expressed as a C string (non-UTF-8 or embedded NUL byte).
InvalidOption(NulError)
A delegate option key/value pair contained an embedded NUL byte.
InterpreterCreateFailed
TfLiteInterpreterCreate returned NULL.
AllocateTensorsFailed
TfLiteInterpreterAllocateTensors returned a non-Ok status.
InvokeFailed
TfLiteInterpreterInvoke returned a non-Ok status.
Fields
status: TfLiteStatusRaw status code returned by the C API.
TensorIndexOutOfBounds
Tensor index was out of bounds for the interpreter.
DtypeMismatch
The tensor’s actual element type did not match the typed accessor.
Fields
expected: TfLiteTypeThe element type the caller requested.
actual: TfLiteTypeThe element type the tensor actually has.
NullTensor
A tensor handle returned by the C API was unexpectedly NULL.
NullData
A tensor’s data pointer was unexpectedly NULL.
DelegateCreateFailed
TfLiteExternalDelegateCreate returned NULL.
DelegateOptionRejected
The C API rejected an external-delegate option (non-Ok status).
Fields
status: TfLiteStatusRaw status returned by the C API.
The loaded TFLite library does not export the TfLiteExternalDelegate*
symbol group, so this crate cannot construct an crate::ExternalDelegate.
These symbols live in TFLite’s experimental C header and are routinely omitted from prebuilt shared objects. The core load → invoke path remains fully functional — only external-delegate construction is blocked.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()