#[non_exhaustive]
pub enum OrtError {
Show 34 variants
FfiStringConversion(OrtApiError),
CreateEnvironment(OrtApiError),
CreateSessionOptions(OrtApiError),
CreateSession(OrtApiError),
GetAllocator(OrtApiError),
GetInOutCount(OrtApiError),
GetInputName(OrtApiError),
GetTypeInfo(OrtApiError),
CastTypeInfoToTensorInfo(OrtApiError),
GetTensorElementType(OrtApiError),
GetDimensionsCount(OrtApiError),
GetDimensions(OrtApiError),
GetStringTensorDataLength(OrtApiError),
GetTensorShapeElementCount(OrtApiError),
CreateCpuMemoryInfo(OrtApiError),
CreateTensor(OrtApiError),
CreateTensorWithData(OrtApiError),
FillStringTensor(OrtApiError),
FailedTensorCheck(OrtApiError),
GetTensorTypeAndShape(OrtApiError),
SessionRun(OrtApiError),
GetTensorMutableData(OrtApiError),
GetStringTensorContent(OrtApiError),
StringFromUtf8Error(FromUtf8Error),
DownloadError(OrtDownloadError),
NonMatchingDimensions(NonMatchingDimensionsError),
FileDoesNotExist {
filename: PathBuf,
},
NonUtf8Path {
path: PathBuf,
},
FfiStringNull(NulError),
PointerShouldBeNull(String),
PointerShouldNotBeNull(String),
UndefinedTensorElementType,
GetModelMetadata(OrtApiError),
DataTypeMismatch {
actual: TensorElementDataType,
requested: TensorElementDataType,
},
}
Expand description
An enum of all errors returned by ORT functions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FfiStringConversion(OrtApiError)
An error occurred when converting an FFI C string to a Rust String
.
CreateEnvironment(OrtApiError)
An error occurred while creating an ONNX environment.
CreateSessionOptions(OrtApiError)
Error occurred when creating ONNX session options.
CreateSession(OrtApiError)
Error occurred when creating an ONNX session.
GetAllocator(OrtApiError)
Error occurred when creating an ONNX allocator.
GetInOutCount(OrtApiError)
Error occurred when counting ONNX session input/output count.
GetInputName(OrtApiError)
Error occurred when getting ONNX input name.
GetTypeInfo(OrtApiError)
Error occurred when getting ONNX type information
CastTypeInfoToTensorInfo(OrtApiError)
Error occurred when casting ONNX type information to tensor information
GetTensorElementType(OrtApiError)
Error occurred when getting tensor elements type
GetDimensionsCount(OrtApiError)
Error occurred when getting ONNX dimensions count
GetDimensions(OrtApiError)
Error occurred when getting ONNX dimensions
GetStringTensorDataLength(OrtApiError)
Error occurred when getting string length
GetTensorShapeElementCount(OrtApiError)
Error occurred when getting tensor element count
CreateCpuMemoryInfo(OrtApiError)
Error occurred when creating CPU memory information
CreateTensor(OrtApiError)
Error occurred when creating ONNX tensor
CreateTensorWithData(OrtApiError)
Error occurred when creating ONNX tensor with specific data
FillStringTensor(OrtApiError)
Error occurred when filling a tensor with string data
FailedTensorCheck(OrtApiError)
Error occurred when checking if ONNX tensor was properly initialized
GetTensorTypeAndShape(OrtApiError)
Error occurred when getting tensor type and shape
SessionRun(OrtApiError)
Error occurred when ONNX inference operation was called
GetTensorMutableData(OrtApiError)
Error occurred when extracting data from an ONNX tensor into an C array to be used as an ndarray::ArrayView
.
GetStringTensorContent(OrtApiError)
Error occurred when extracting string data from an ONNX tensor
StringFromUtf8Error(FromUtf8Error)
Error occurred when converting data to a String
DownloadError(OrtDownloadError)
Error occurred when downloading a pre-trained ONNX model from the ONNX Model Zoo.
NonMatchingDimensions(NonMatchingDimensionsError)
Dimensions of input data and the ONNX model do not match.
FileDoesNotExist
File does not exist
NonUtf8Path
Path is invalid UTF-8
FfiStringNull(NulError)
Attempt to build a Rust CString
when the original string contains a null character.
PointerShouldBeNull(String)
ORT pointer should have been null
PointerShouldNotBeNull(String)
ORT pointer should not have been null
UndefinedTensorElementType
The runtime type was undefined.
GetModelMetadata(OrtApiError)
Could not retrieve model metadata.
DataTypeMismatch
Fields
actual: TensorElementDataType
The actual type of the ort output
requested: TensorElementDataType
The type corresponding to the attempted conversion into a Rust type, not equal to actual
The user tried to extract the wrong type of tensor from the underlying data