Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

IModelInferEngineLoadModel 方法

Loads and initializes the model with specified configuration. 使用指定配置加载并初始化模型。

Definition

命名空间: DeploySharp.Engine
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
void LoadModel(
	ref IConfig config
)

参数

config  IConfig
Reference to model configuration object containing: - Model path/bytes - Hardware/execution provider settings - Input/output specifications Optional preprocessing/postprocessing parameters 引用模型配置对象,包含: - 模型路径/字节数据 - 硬件/执行提供程序设置 - 输入/输出规范 - 可选的预处理/后处理参数

备注

The configuration object may be modified during loading to reflect: - Actual model input/output shapes - Supported precision modes - Available execution providers - Optimized parameters 配置对象可能在加载过程中被修改以反映: - 实际模型输入/输出形状 - 支持的精度模式 - 可用的执行提供程序 - 优化参数

Implementations should validate configuration parameters before loading. 实现应在加载前验证配置参数。

异常

ArgumentNullException Thrown when config is null. 当config为null时抛出。
FileNotFoundException Thrown when model file cannot be found. 当找不到模型文件时抛出。
InvalidOperationException Thrown when model initialization fails. 当模型初始化失败时抛出。

参见