SavedModelBundle
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
継承されたメソッド
クラスjava.lang.Objectからブール値 | 等しい(オブジェクト arg0) |
最終クラス<?> | getクラス() |
整数 | ハッシュコード() |
最後の空白 | 通知する() |
最後の空白 | すべて通知() |
弦 | toString () |
最後の空白 | wait (long arg0, int arg1) |
最後の空白 | 待機(長い引数0) |
最後の空白 | 待って() |
インターフェース java.lang.AutoCloseable から パブリックメソッド
公開グラフグラフ()
モデルによって実行された計算を説明するグラフを返します。
保存されたモデルをエクスポート ディレクトリからロードします。ロードされるモデルは、保存されたモデル APIを使用して作成する必要があります。
このメソッドは次の短縮形です。
SavedModelBundle.loader().withTags(tags).load();
パラメータ
エクスポートディレクトリ | 保存されたモデルを含むディレクトリ パス。 |
---|
タグ | ロードする特定のメタグラフ定義を識別するタグ。 |
---|
保存したモデルをロードします。
実際にモデルをロードする前に構成オプションを設定できる
Loader
オブジェクトを返します。
パラメータ
エクスポートディレクトリ | 保存されたモデルを含むディレクトリ パス。 |
---|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。一部のコンテンツは numpy ライセンスにより使用許諾されます。
最終更新日 2025-07-28 UTC。
[null,null,["最終更新日 2025-07-28 UTC。"],[],[],null,["# SavedModelBundle\n\npublic class **SavedModelBundle** \n\nSavedModelBundle represents a model loaded from storage.\n\n\nThe model consists of a description of the computation (a\n`\n`[Graph](/versions/r2.5/api_docs/java/org/tensorflow/Graph)`\n`\n), a\n`\n`[Session](/versions/r2.5/api_docs/java/org/tensorflow/Session)`\n`\nwith tensors (e.g., parameters or variables in the graph) initialized to values saved in storage,\nand a description of the model (a serialized representation of a\n[MetaGraphDef\nprotocol buffer](https://www.tensorflow.org/code/tensorflow/core/protobuf/meta_graph.proto)\n).\n\n\u003cbr /\u003e\n\n### Nested Classes\n\n|-------|---|---|-----------------------------------|\n| class | [SavedModelBundle.Loader](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle.Loader) || Options for loading a SavedModel. |\n\n### Public Methods\n\n|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [close](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle#close()) () Releases resources (the ` `[Graph](/versions/r2.5/api_docs/java/org/tensorflow/Graph)` ` and ` `[Session](/versions/r2.5/api_docs/java/org/tensorflow/Session)` ` ) associated with the saved model bundle. |\n| [Graph](/versions/r2.5/api_docs/java/org/tensorflow/Graph) | [graph](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle#graph()) () Returns the graph that describes the computation performed by the model. |\n| static [SavedModelBundle](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle) | [load](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle#load(java.lang.String, java.lang.String...)) (String exportDir, String... tags) Load a saved model from an export directory. |\n| static [SavedModelBundle.Loader](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle.Loader) | [loader](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle#loader(java.lang.String)) (String exportDir) Load a saved model. |\n| byte\\[\\] | [metaGraphDef](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle#metaGraphDef()) () Returns the serialized [MetaGraphDef protocol buffer](https://www.tensorflow.org/code/tensorflow/core/protobuf/meta_graph.proto) associated with the saved model. |\n| [Session](/versions/r2.5/api_docs/java/org/tensorflow/Session) | [session](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle#session()) () Returns the ` `[Session](/versions/r2.5/api_docs/java/org/tensorflow/Session)` ` with which to perform computation using the model. |\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\nFrom interface java.lang.AutoCloseable \n\n|---------------|----------|\n| abstract void | close () |\n\nPublic Methods\n--------------\n\n\n#### public void\n**close**\n()\n\n\nReleases resources (the\n`\n`[Graph](/versions/r2.5/api_docs/java/org/tensorflow/Graph)`\n`\nand\n`\n`[Session](/versions/r2.5/api_docs/java/org/tensorflow/Session)`\n`\n) associated with the saved model\nbundle.\n\n#### public [Graph](/versions/r2.5/api_docs/java/org/tensorflow/Graph)\n**graph**\n()\n\n\nReturns the graph that describes the computation performed by the model.\n\n#### public static [SavedModelBundle](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle)\n**load**\n(String exportDir, String... tags)\n\n\nLoad a saved model from an export directory. The model that is being loaded should be created\nusing the\n[Saved Model\nAPI](https://www.tensorflow.org/api_docs/python/tf/saved_model)\n.\n\n\nThis method is a shorthand for: \n\n SavedModelBundle.loader().withTags(tags).load();\n \n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| exportDir | the directory path containing a saved model. |\n| tags | the tags identifying the specific metagraphdef to load. |\n|-----------|---------------------------------------------------------|\n\n##### Returns\n\n- a bundle containing the graph and associated session.\n\n#### public static [SavedModelBundle.Loader](/versions/r2.5/api_docs/java/org/tensorflow/SavedModelBundle.Loader)\n**loader**\n(String exportDir)\n\n\nLoad a saved model.\n\n\nReturns a `\nLoader\n` object that can set configuration options before actually loading the model,\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| exportDir | the directory path containing a saved model. |\n|-----------|----------------------------------------------|\n\n\n#### public byte\\[\\]\n**metaGraphDef**\n()\n\n\nReturns the serialized\n[MetaGraphDef\nprotocol buffer](https://www.tensorflow.org/code/tensorflow/core/protobuf/meta_graph.proto)\nassociated with the saved model.\n\n#### public [Session](/versions/r2.5/api_docs/java/org/tensorflow/Session)\n**session**\n()\n\n\nReturns the\n`\n`[Session](/versions/r2.5/api_docs/java/org/tensorflow/Session)`\n`\nwith which to perform computation using the model. \n\n##### Returns\n\n- the initialized session"]]