語言

ModelOperationsCatalog 類別

定義

類別用於 MLContext 儲存和載入訓練好的模型。

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

方法

名稱 Description
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)

儲存一個 transformer 模型和用來訓練的資料結構到檔案。

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

儲存一個變壓器模型及用於建立輸入資料的載入器。

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

儲存一個轉換器模型以及用來建立輸入資料的載入器。

擴充方法

名稱 Description
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() 或以「使用」語法宣告變數來釋放的未管理資源的參考。>

<格式類型=“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() 或以「使用」語法宣告變數來釋放的未管理資源的參考。>

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

適用於