SavedModelBundle.Exporter
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Các tùy chọn để xuất SavingModel.
Phương pháp kế thừa
Từ lớp java.lang.Object boolean | bằng (Đối tượng arg0) |
Lớp cuối cùng<?> | getClass () |
int | Mã Băm () |
khoảng trống cuối cùng | thông báo () |
khoảng trống cuối cùng | thông báoTất cả () |
Sợi dây | toString () |
khoảng trống cuối cùng | chờ đã (arg0 dài, int arg1) |
khoảng trống cuối cùng | chờ đã (arg0 dài) |
khoảng trống cuối cùng | Chờ đợi () |
Phương pháp công khai
xuất void công khai ()
Lưu mô hình vào thư mục xuất.
Ném
IOException | nếu mô hình đã lưu hoặc trạng thái biến không thể ghi vào đĩa |
---|
Lưu một chức năng cụ thể của mô hình này.
Hàm cụ thể mang một chữ ký (tức là danh sách các tên đầu vào và đầu ra thân thiện với người dùng cho biểu đồ) và một phiên hợp lệ cho biểu đồ sẽ được lưu trong mô hình.
Lưu ý: Cuối cùng, TensorFlow cho Java sẽ hỗ trợ xuất các đối tượng hàm giống như API Python nhưng hiện tại, chỉ các mô hình tập trung vào phiên mới được hỗ trợ (tức là các mô hình có một biểu đồ chính duy nhất và một hoặc nhiều chữ ký). Các mô hình này tương thích với các mô hình được xuất bởi công cụ ước tính TensorFlow 1.x hoặc TensorFlow 2.x.
Do đó, tất cả các hàm được xuất trong một mô hình phải chia sẻ cùng một phiên vào thời điểm hiện tại, nếu không sẽ xảy ra ngoại lệ.
Thông số
chức năng | một hàm mang chữ ký và phiên hợp lệ vào biểu đồ sẽ được lưu |
---|
Ném
Ngoại lệ Đối số bất hợp pháp | nếu một hàm có cùng tên đã được thêm vào mô hình |
---|
Ngoại lệ hoạt động không được hỗ trợ | nếu chức năng này không chia sẻ cùng phiên với các chức năng khác được thêm vào mô hình này |
---|
Đặt bộ thẻ xác định biểu đồ cụ thể trong mô hình đã lưu để lưu.
Lưu ý rằng hiện tại chỉ có thể lưu một biểu đồ cho mỗi mô hình bằng API này.
Thông số
thẻ | các thẻ xác định MetaGraphDef cụ thể để lưu. |
---|
Ném
Ngoại lệ Đối số bất hợp pháp | nếu thẻ không hợp lệ |
---|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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|--------------------------|---------------------|"]]