语言

ModelOperationsCatalog 类

定义

用于 MLContext 保存和加载已训练模型的类。

public sealed class ModelOperationsCatalog
type ModelOperationsCatalog = class
Public NotInheritable Class ModelOperationsCatalog
继承
ModelOperationsCatalog

方法

名称 说明
CreatePredictionEngine<TSrc,TDst>(ITransformer, Boolean, SchemaDefinition, SchemaDefinition)

为一次性预测(默认使用情况)创建预测引擎。

CreatePredictionEngine<TSrc,TDst>(ITransformer, DataViewSchema)

为一次性预测创建预测引擎。 它主要用于 Load(Stream, DataViewSchema)加载模型期间提取输入架构。

CreatePredictionEngine<TSrc,TDst>(ITransformer, PredictionEngineOptions)

为一次性预测创建预测引擎。 它主要用于 Load(Stream, DataViewSchema)加载模型期间提取输入架构。

Load(Stream, DataViewSchema)

从流加载模型及其输入架构。

Load(String, DataViewSchema)

从文件加载模型及其输入架构。

LoadWithDataLoader(Stream, IDataLoader<IMultiStreamSource>)

从流加载转换器模型和数据加载程序模型。

LoadWithDataLoader(String, IDataLoader<IMultiStreamSource>)

从文件加载转换器模型和数据加载程序模型。

Save(ITransformer, DataViewSchema, Stream)

保存转换器模型和用于将其训练到流的数据的架构。

Save(ITransformer, DataViewSchema, String)

保存转换器模型和用于将它训练到文件的数据的架构。

Save<TSource>(ITransformer, IDataLoader<TSource>, Stream)

保存转换器模型和用于创建流输入数据的加载程序。

Save<TSource>(ITransformer, IDataLoader<TSource>, String)

保存转换器模型以及用于创建其输入数据的加载程序到文件。

扩展方法

名称 说明
ConvertToOnnx(ModelOperationsCatalog, ITransformer, IDataView, Int32, Stream)

将指定的 ITransformer ONNX 格式转换为流并写入流。

ConvertToOnnx(ModelOperationsCatalog, ITransformer, IDataView, Stream, String[])

将指定的 ITransformer ONNX 格式转换为流并写入流。

ConvertToOnnx(ModelOperationsCatalog, ITransformer, IDataView, Stream)

将指定的 ITransformer ONNX 格式转换为流并写入流。

LoadTensorFlowModel(ModelOperationsCatalog, String, Boolean)

将 TensorFlow 模型加载到内存中。 这是一种方便的方法,它允许加载一次模型,并随后使用它来查询架构和使用TensorFlowEstimatorScoreTensorFlowModel(String, String, Boolean)。 使用此 API 需要 TensorFlow redist 上的其他 NuGet 依赖项,有关详细信息,请参阅链接文档。 TensorFlowModel 还保留对非托管资源的引用,这些资源需要使用对 Dispose() 的显式调用释放,或通过使用“using”语法声明变量进行隐式调用/>

<format type=“text/markdown”> [!include[io](~/../docs/samples/docs/api-reference/tensorflow-usage.md)] </format>
LoadTensorFlowModel(ModelOperationsCatalog, String)

将 TensorFlow 模型加载到内存中。 这是一种方便的方法,它允许加载一次模型,并随后使用它来查询架构和使用TensorFlowEstimatorScoreTensorFlowModel(String, String, Boolean)。 使用此 API 需要 TensorFlow redist 上的其他 NuGet 依赖项,有关详细信息,请参阅链接文档。 TensorFlowModel 还保留对非托管资源的引用,这些资源需要使用对 Dispose() 的显式调用释放,或通过使用“using”语法声明变量进行隐式调用/>

<format type=“text/markdown”> [!include[io](~/../docs/samples/docs/api-reference/tensorflow-usage.md)] </format>

适用于