Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document OpenVINO backend support #2028

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions templates/keras_3/keras_3_announcement.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
After five months of extensive public beta testing,
we're excited to announce the official release of Keras 3.0.
Keras 3 is a full rewrite of Keras that enables you to
run your Keras workflows on top of either JAX, TensorFlow, or PyTorch, and that
unlocks brand new large-scale model training and deployment capabilities.
run your Keras workflows on top of either JAX, TensorFlow, PyTorch, or OpenVINO (for inference-only),
rkazants marked this conversation as resolved.
Show resolved Hide resolved
and that unlocks brand new large-scale model training and deployment capabilities.
You can pick the framework that suits you best,
and switch from one to another based on your current goals.
You can also use Keras as a low-level cross-framework language
Expand Down Expand Up @@ -257,6 +257,32 @@ as long as you've implemented the stateful version (e.g. `call()` or `update_sta

---

## Run inference with the OpenVINO backend.

Starting with release 3.8, Keras introduces the OpenVINO backend that is an inference-only backend,
meaning it is designed only for running model predictions using `predict()` method.
This backend enables to leverage OpenVINO performance optimizations directly
within the Keras workflow, enabling faster inference on OpenVINO supported hardware.

To switch to the OpenVINO backend, set the KERAS_BACKEND environment variable
to `"openvino"` or specify the backend in the local configuration file at `~/.keras/keras.json`.
Here is an example of how to infer a model (trained with PyTorch, JAX, or TensorFlow backends),
using the OpenVINO backend:

```python
import os
os.environ["KERAS_BACKEND"] = "openvino"
import keras

loaded_model = keras.saving.load_model(...)
predictions = loaded_model.predict(...)
```

Note that the OpenVINO backend may currently lack support for some operations.
This will be addressed in upcoming Keras releases as operation coverage is being expanded.

---

## Moving from Keras 2 to Keras 3

Keras 3 is highly backwards compatible with Keras 2:
Expand Down
2 changes: 1 addition & 1 deletion theme/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1 class="mb-5">Simple. Flexible. Powerful.</h1>
<div class="row">
<div class="col-xl-8 mx-auto" id="announcement-box">
Keras is now available for<br>
JAX, TensorFlow, and PyTorch!<br>
JAX, TensorFlow, PyTorch, and OpenVINO!<br>
<a href="/keras_3/" id="announcement-link">Read the Keras 3.0 release announcement</a>
</div>
</div>
Expand Down