Skip to content

Commit

Permalink
Document OpenVINO backend support (#2028)
Browse files Browse the repository at this point in the history
* Document OpenVINO backend support

Signed-off-by: Kazantsev, Roman <[email protected]>

* Update templates/keras_3/keras_3_announcement.md

* Apply suggestions from code review

---------

Signed-off-by: Kazantsev, Roman <[email protected]>
  • Loading branch information
rkazants authored Jan 13, 2025
1 parent b7a95a5 commit 616bc30
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
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),
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

0 comments on commit 616bc30

Please sign in to comment.