SavedModelBundle.Exporter
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
SavedModel をエクスポートするためのオプション。
継承されたメソッド
クラスjava.lang.Objectからブール値 | 等しい(オブジェクト arg0) |
最終クラス<?> | getクラス() |
整数 | ハッシュコード() |
最後の空白 | 通知する() |
最後の空白 | すべて通知() |
弦 | toString () |
最後の空白 | wait (long arg0, int arg1) |
最後の空白 | 待機(長い引数0) |
最後の空白 | 待って() |
パブリックメソッド
public voidエクスポート()
投げる
IO例外 | 保存されたモデルまたは変数の状態をディスクに書き込めない場合 |
---|
このモデルの具体的な関数を保存します。
具体的な関数は、署名 (つまり、グラフへのユーザーフレンドリーな入力および出力名のリスト) と、モデルに保存されるグラフへの有効なセッションを保持します。
注:最終的には、TensorFlow for Java は Python API と同様に関数オブジェクトのエクスポートをサポートする予定ですが、現時点ではセッション中心のモデル (つまり、単一のメイン グラフと 1 つ以上のシグネチャを持つモデル) のみがサポートされています。これらのモデルは、TensorFlow 1.x または TensorFlow 2.x エスティメーターによってエクスポートされたモデルと互換性があります。
したがって、モデルでエクスポートされたすべての関数は、現時点では同じセッションを共有する必要があります。共有しないと、例外がスローされます。
パラメーター
関数 | 保存されるグラフへの署名と有効なセッションを運ぶ関数 |
---|
投げる
IllegalArgumentException | 同じ名前の関数がすでにモデルに追加されている場合 |
---|
UnsupportedOperationException | この関数がこのモデルに追加された他の関数と同じセッションを共有しない場合 |
---|
保存する保存モデル内の特定のグラフを識別するタグのセットを設定します。
現時点では、この API を使用して保存できるグラフはモデルごとに 1 つだけであることに注意してください。
パラメーター
タグ | 保存する特定の MetaGraphDef を識別するタグ。 |
---|
投げる
IllegalArgumentException | タグが無効な場合 |
---|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# SavedModelBundle.Exporter\n\npublic static final class **SavedModelBundle.Exporter** \nOptions for exporting a SavedModel. \n\n### Public Methods\n\n|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [export](/jvm/api_docs/java/org/tensorflow/SavedModelBundle.Exporter#export())() Save the model into the export directory. |\n| [SavedModelBundle.Exporter](/jvm/api_docs/java/org/tensorflow/SavedModelBundle.Exporter) | [withFunction](/jvm/api_docs/java/org/tensorflow/SavedModelBundle.Exporter#withFunction(org.tensorflow.ConcreteFunction))([ConcreteFunction](/jvm/api_docs/java/org/tensorflow/ConcreteFunction) function) Save a concrete function of this model. |\n| [SavedModelBundle.Exporter](/jvm/api_docs/java/org/tensorflow/SavedModelBundle.Exporter) | [withTags](/jvm/api_docs/java/org/tensorflow/SavedModelBundle.Exporter#withTags(java.lang.String...))(String... tags) Sets the set of tags that identify the specific graph in the saved model to save. |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public void\n**export**\n()\n\nSave the model into the export directory. \n\n##### Throws\n\n| IOException | if saved model or variable state cannot be written on disk |\n|-------------|------------------------------------------------------------|\n\n#### public [SavedModelBundle.Exporter](/jvm/api_docs/java/org/tensorflow/SavedModelBundle.Exporter)\n**withFunction**\n([ConcreteFunction](/jvm/api_docs/java/org/tensorflow/ConcreteFunction) function)\n\nSave a concrete function of this model.\n\nThe concrete function carries a signature (i.e. a list of user-friendly input and outputs\nnames to a graph) and a valid session to a graph to be saved in the model.\n\n*Note:Eventually, TensorFlow for Java will support the export of functions objects like\nthe Python API does but right now, only session-centric models are supported (i.e. models that\nhas a single main graph and one or more signatures). These models are compatible with those\nexported by TensorFlow 1.x or by TensorFlow 2.x estimators.\n\u003cbr /\u003e\nTherefore, all functions exported in a model should share the same session at the moment\nor an exception will be thrown.*\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| function | a function carrying a signature and a valid session to the graph to be saved |\n|----------|------------------------------------------------------------------------------|\n\n##### Returns\n\n- this object \n\n##### Throws\n\n| IllegalArgumentException | if a function with the same name has already been added to the model |\n| UnsupportedOperationException | if this function does not share the same session with the other functions added to this model |\n|-------------------------------|-----------------------------------------------------------------------------------------------|\n\n#### public [SavedModelBundle.Exporter](/jvm/api_docs/java/org/tensorflow/SavedModelBundle.Exporter)\n**withTags**\n(String... tags)\n\nSets the set of tags that identify the specific graph in the saved model to save.\n\nNote that only one graph per model can be saved right now using this API.\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| tags | the tags identifying the specific MetaGraphDef to save. |\n|------|---------------------------------------------------------|\n\n##### Returns\n\n- this object \n\n##### Throws\n\n| IllegalArgumentException | if tags are invalid |\n|--------------------------|---------------------|"]]