SavedModelBundle.Exporter
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวเลือกสำหรับการส่งออก SavedModel
วิธีการสืบทอด
จากคลาส java.lang.Object บูลีน | เท่ากับ (วัตถุ arg0) |
คลาสสุดท้าย<?> | รับคลาส () |
ภายใน | แฮชโค้ด () |
โมฆะสุดท้าย | แจ้ง () |
โมฆะสุดท้าย | แจ้งทั้งหมด () |
สตริง | toString () |
โมฆะสุดท้าย | รอสักครู่ (ยาว arg0, int arg1) |
โมฆะสุดท้าย | รอ (ยาว arg0) |
โมฆะสุดท้าย | รอ () |
วิธีการสาธารณะ
การส่งออก โมฆะสาธารณะ ()
บันทึกโมเดลลงในไดเร็กทอรีการส่งออก
ขว้าง
IOข้อยกเว้น | หากไม่สามารถเขียนโมเดลหรือสถานะตัวแปรที่บันทึกไว้บนดิสก์ได้ |
---|
บันทึกฟังก์ชั่นที่เป็นรูปธรรมของรุ่นนี้
ฟังก์ชันที่เป็นรูปธรรมประกอบด้วยลายเซ็น (เช่น รายการชื่ออินพุตและเอาต์พุตที่ใช้งานง่ายไปยังกราฟ) และเซสชันที่ถูกต้องไปยังกราฟที่จะบันทึกในแบบจำลอง
หมายเหตุ:ในที่สุดแล้ว TensorFlow สำหรับ Java จะรองรับการส่งออกฟังก์ชันออบเจ็กต์เหมือนกับที่ Python API ทำ แต่ตอนนี้รองรับเฉพาะโมเดลที่เน้นเซสชันเป็นศูนย์กลางเท่านั้น (เช่น โมเดลที่มีกราฟหลักเดี่ยวและลายเซ็นอย่างน้อยหนึ่งลายเซ็น) โมเดลเหล่านี้เข้ากันได้กับโมเดลที่ส่งออกโดย TensorFlow 1.x หรือโดยตัวประมาณค่า TensorFlow 2.x
ดังนั้น ฟังก์ชันทั้งหมดที่ส่งออกในแบบจำลองควรใช้เซสชันเดียวกันร่วมกันในขณะนี้ ไม่เช่นนั้นข้อยกเว้นจะถูกส่งออกไป
พารามิเตอร์
การทำงาน | ฟังก์ชันที่มีลายเซ็นและเซสชันที่ถูกต้องบนกราฟที่จะบันทึก |
---|
ขว้าง
ข้อยกเว้นอาร์กิวเมนต์ที่ผิดกฎหมาย | หากมีการเพิ่มฟังก์ชันที่มีชื่อเดียวกันลงในโมเดลแล้ว |
---|
ไม่รองรับ OperationException | หากฟังก์ชันนี้ไม่ได้แชร์เซสชันเดียวกันกับฟังก์ชันอื่นๆ ที่เพิ่มเข้ามาในโมเดลนี้ |
---|
ตั้งค่าชุดแท็กที่ระบุกราฟเฉพาะในโมเดลที่บันทึกไว้เพื่อบันทึก
โปรดทราบว่าขณะนี้สามารถบันทึกกราฟได้เพียงกราฟเดียวต่อโมเดลโดยใช้ API นี้
พารามิเตอร์
แท็ก | แท็กที่ระบุ MetaGraphDef เฉพาะที่จะบันทึก |
---|
ขว้าง
ข้อยกเว้นอาร์กิวเมนต์ที่ผิดกฎหมาย | หากแท็กไม่ถูกต้อง |
---|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 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|--------------------------|---------------------|"]]