SavedModelBundle.Exporter
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
گزینه هایی برای صادرات SavedModel.
روش های ارثی
از کلاس java.lang.Object بولی | برابر است (شیء arg0) |
کلاس نهایی<?> | getClass () |
بین المللی | هش کد () |
باطل نهایی | اعلام کردن () |
باطل نهایی | اطلاع رسانی به همه () |
رشته | toString () |
باطل نهایی | صبر کنید (long arg0، int arg1) |
باطل نهایی | صبر کنید (طولانی arg0) |
باطل نهایی | صبر کن () |
روش های عمومی
صادرات خالی عمومی ()
مدل را در فهرست صادرات ذخیره کنید.
پرتاب می کند
IOException | اگر مدل ذخیره شده یا وضعیت متغیر را نمی توان روی دیسک نوشت |
---|
یک عملکرد مشخص از این مدل را ذخیره کنید.
تابع بتن دارای یک امضا (یعنی لیستی از ورودی های کاربرپسند و خروجی نام ها به یک گراف) و یک جلسه معتبر برای یک نمودار برای ذخیره در مدل است.
توجه: در نهایت، TensorFlow برای جاوا از صادرات توابعی مانند API پایتون پشتیبانی میکند، اما در حال حاضر، فقط مدلهای جلسه محور پشتیبانی میشوند (یعنی مدلهایی که دارای یک گراف اصلی و یک یا چند امضا هستند). این مدلها با مدلهایی که توسط تخمینگرهای TensorFlow 1.x یا TensorFlow 2.x صادر شدهاند سازگار هستند.
بنابراین، تمام توابع صادر شده در یک مدل باید همان جلسه را در لحظه به اشتراک بگذارند یا یک استثنا ایجاد می شود.
مولفه های
تابع | تابعی که یک امضا و یک جلسه معتبر در نمودار ذخیره می شود |
---|
پرتاب می کند
IllegalArgumentException | اگر تابعی با همین نام قبلاً به مدل اضافه شده باشد |
---|
UnsupportedOperationException | اگر این تابع همان جلسه را با سایر توابع اضافه شده به این مدل به اشتراک نگذارد |
---|
مجموعه ای از برچسب ها را تنظیم می کند که نمودار خاصی را در مدل ذخیره شده برای ذخیره مشخص می کند.
توجه داشته باشید که در حال حاضر با استفاده از این API فقط یک نمودار در هر مدل قابل ذخیره است.
مولفه های
برچسب ها | برچسب هایی که MetaGraphDef خاصی را برای ذخیره شناسایی می کنند. |
---|
پرتاب می کند
IllegalArgumentException | اگر برچسب ها نامعتبر هستند |
---|
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-27 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-27 بهوقت ساعت هماهنگ جهانی."],[],[],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|--------------------------|---------------------|"]]