org.tensorflow
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Определяет классы для создания, сохранения, загрузки и выполнения моделей TensorFlow.
ВНИМАНИЕ : API в настоящее время является экспериментальным и не покрывается гарантиями стабильности API TensorFlow. Инструкции по установке см. в README.md .
Пример LabelImage демонстрирует использование этого API для классификации изображений с использованием предварительно обученной сверточной нейронной сети архитектуры Inception . Он демонстрирует:
- Построение графа: использование класса OperationBuilder для построения графа для декодирования, изменения размера и нормализации изображения JPEG.
- Загрузка модели: использование Graph.importGraphDef() для загрузки предварительно обученной начальной модели.
- Выполнение графика: использование сеанса для выполнения графиков и поиска лучшей метки для изображения.
Дополнительные примеры можно найти в репозитории tensorflow/models на GitHub.
Интерфейсы
Классы
Перечисления
Исключения
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-26 UTC.
[null,null,["Последнее обновление: 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\nAdditional examples can be found in the [tensorflow/models](https://github.com/tensorflow/models/tree/master/samples/languages/java)\nGitHub repository.\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. |"]]