org.tensorflow
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.
Xác định các lớp để xây dựng, lưu, tải và thực thi các mô hình TensorFlow.
CẢNH BÁO : API hiện đang thử nghiệm và không được đảm bảo tính ổn định của API TensorFlow. Xem README.md để biết hướng dẫn cài đặt.
Ví dụ về LabelImage thể hiện việc sử dụng API này để phân loại hình ảnh bằng cách sử dụng mạng thần kinh tích chập kiến trúc Inception được đào tạo trước. Nó thể hiện:
- Xây dựng biểu đồ: sử dụng lớp OperationBuilder để xây dựng biểu đồ nhằm giải mã, thay đổi kích thước và chuẩn hóa hình ảnh JPEG.
- Tải mô hình: Sử dụng Graph.importGraphDef() để tải mô hình Khởi động được đào tạo trước.
- Thực thi biểu đồ: Sử dụng Phiên để thực thi biểu đồ và tìm nhãn tốt nhất cho hình ảnh.
Giao diện
Các lớp học
Enum
Ngoại 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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# org.tensorflow\n\nDefines classes to build, save, load and execute TensorFlow models.\n\n**WARNING** : The API is currently experimental and is not covered by TensorFlow [API stability guarantees](https://www.tensorflow.org/guide/version_compat). See [README.md](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/README.md)\nfor installation instructions.\n\nThe [LabelImage](https://www.tensorflow.org/code/tensorflow/java/src/main/java/org/tensorflow/examples/LabelImage.java)\nexample demonstrates use of this API to classify images using a pre-trained [Inception](http://arxiv.org/abs/1512.00567) architecture convolutional neural network.\nIt demonstrates:\n\n- Graph construction: using the OperationBuilder class to construct a graph to decode, resize and normalize a JPEG image.\n- Model loading: Using Graph.importGraphDef() to load a pre-trained Inception model.\n- Graph execution: Using a Session to execute the graphs and find the best label for an image.\n\n### Interfaces\n\n|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [ExecutionEnvironment](/api_docs/java/reference/org/tensorflow/ExecutionEnvironment) | Defines an environment for creating and executing TensorFlow [Operation](/api_docs/java/reference/org/tensorflow/Operation)s. |\n| [Graph.WhileSubgraphBuilder](/api_docs/java/reference/org/tensorflow/Graph.WhileSubgraphBuilder) | Used to instantiate an abstract class which overrides the buildSubgraph method to build a conditional or body subgraph for a while loop. |\n| [Operand](/api_docs/java/reference/org/tensorflow/Operand)\\\u003cT\\\u003e | Interface implemented by operands of a TensorFlow operation. |\n| [Operation](/api_docs/java/reference/org/tensorflow/Operation) | Performs computation on Tensors. |\n| [OperationBuilder](/api_docs/java/reference/org/tensorflow/OperationBuilder) | A builder for [Operation](/api_docs/java/reference/org/tensorflow/Operation)s. |\n\n### Classes\n\n|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [EagerSession](/api_docs/java/reference/org/tensorflow/EagerSession) | An environment for executing TensorFlow operations eagerly. |\n| [EagerSession.Options](/api_docs/java/reference/org/tensorflow/EagerSession.Options) | |\n| [Graph](/api_docs/java/reference/org/tensorflow/Graph) | A data flow graph representing a TensorFlow computation. |\n| [GraphOperation](/api_docs/java/reference/org/tensorflow/GraphOperation) | Implementation for an [Operation](/api_docs/java/reference/org/tensorflow/Operation) added as a node to a [Graph](/api_docs/java/reference/org/tensorflow/Graph). |\n| [GraphOperationBuilder](/api_docs/java/reference/org/tensorflow/GraphOperationBuilder) | An [OperationBuilder](/api_docs/java/reference/org/tensorflow/OperationBuilder) for adding [GraphOperation](/api_docs/java/reference/org/tensorflow/GraphOperation)s to a [Graph](/api_docs/java/reference/org/tensorflow/Graph). |\n| [Output](/api_docs/java/reference/org/tensorflow/Output)\\\u003cT\\\u003e | A symbolic handle to a tensor produced by an [Operation](/api_docs/java/reference/org/tensorflow/Operation). |\n| [SavedModelBundle](/api_docs/java/reference/org/tensorflow/SavedModelBundle) | SavedModelBundle represents a model loaded from storage. |\n| [SavedModelBundle.Loader](/api_docs/java/reference/org/tensorflow/SavedModelBundle.Loader) | Options for loading a SavedModel. |\n| [Server](/api_docs/java/reference/org/tensorflow/Server) | An in-process TensorFlow server, for use in distributed training. |\n| [Session](/api_docs/java/reference/org/tensorflow/Session) | Driver for [Graph](/api_docs/java/reference/org/tensorflow/Graph) execution. |\n| [Session.Run](/api_docs/java/reference/org/tensorflow/Session.Run) | Output tensors and metadata obtained when executing a session. |\n| [Session.Runner](/api_docs/java/reference/org/tensorflow/Session.Runner) | Run [Operation](/api_docs/java/reference/org/tensorflow/Operation)s and evaluate [Tensors](/api_docs/java/reference/org/tensorflow/Tensor). |\n| [Shape](/api_docs/java/reference/org/tensorflow/Shape) | The possibly partially known shape of a tensor produced by an operation. |\n| [Tensor](/api_docs/java/reference/org/tensorflow/Tensor)\\\u003cT\\\u003e | A statically typed multi-dimensional array whose elements are of a type described by T. |\n| [TensorFlow](/api_docs/java/reference/org/tensorflow/TensorFlow) | Static utility methods describing the TensorFlow runtime. |\n| [Tensors](/api_docs/java/reference/org/tensorflow/Tensors) | Type-safe factory methods for creating [Tensor](/api_docs/java/reference/org/tensorflow/Tensor) objects. |\n\n### Enums\n\n|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|\n| [DataType](/api_docs/java/reference/org/tensorflow/DataType) | Represents the type of elements in a [Tensor](/api_docs/java/reference/org/tensorflow/Tensor) as an enum. |\n| [EagerSession.DevicePlacementPolicy](/api_docs/java/reference/org/tensorflow/EagerSession.DevicePlacementPolicy) | Controls how to act when we try to run an operation on a given device but some input tensors are not on that device. |\n| [EagerSession.ResourceCleanupStrategy](/api_docs/java/reference/org/tensorflow/EagerSession.ResourceCleanupStrategy) | Controls how TensorFlow resources are cleaned up when they are no longer needed. |\n\n### Exceptions\n\n|------------------------------------------------------------------------------------|--------------------------------------------------------------|\n| [TensorFlowException](/api_docs/java/reference/org/tensorflow/TensorFlowException) | Unchecked exception thrown when executing TensorFlow Graphs. |"]]