|
1 | 1 | After five months of extensive public beta testing, |
2 | 2 | we're excited to announce the official release of Keras 3.0. |
3 | 3 | Keras 3 is a full rewrite of Keras that enables you to |
4 | | -run your Keras workflows on top of either JAX, TensorFlow, or PyTorch, and that |
5 | | -unlocks brand new large-scale model training and deployment capabilities. |
| 4 | +run your Keras workflows on top of either JAX, TensorFlow, PyTorch, or OpenVINO (for inference-only), |
| 5 | +and that unlocks brand new large-scale model training and deployment capabilities. |
6 | 6 | You can pick the framework that suits you best, |
7 | 7 | and switch from one to another based on your current goals. |
8 | 8 | You can also use Keras as a low-level cross-framework language |
@@ -257,6 +257,32 @@ as long as you've implemented the stateful version (e.g. `call()` or `update_sta |
257 | 257 |
|
258 | 258 | --- |
259 | 259 |
|
| 260 | +## Run inference with the OpenVINO backend. |
| 261 | + |
| 262 | +Starting with release 3.8, Keras introduces the OpenVINO backend that is an inference-only backend, |
| 263 | +meaning it is designed only for running model predictions using `predict()` method. |
| 264 | +This backend enables to leverage OpenVINO performance optimizations directly |
| 265 | +within the Keras workflow, enabling faster inference on OpenVINO supported hardware. |
| 266 | + |
| 267 | +To switch to the OpenVINO backend, set the KERAS_BACKEND environment variable |
| 268 | +to `"openvino"` or specify the backend in the local configuration file at `~/.keras/keras.json`. |
| 269 | +Here is an example of how to infer a model (trained with PyTorch, JAX, or TensorFlow backends), |
| 270 | +using the OpenVINO backend: |
| 271 | + |
| 272 | +```python |
| 273 | +import os |
| 274 | +os.environ["KERAS_BACKEND"] = "openvino" |
| 275 | +import keras |
| 276 | + |
| 277 | +loaded_model = keras.saving.load_model(...) |
| 278 | +predictions = loaded_model.predict(...) |
| 279 | +``` |
| 280 | + |
| 281 | +Note that the OpenVINO backend may currently lack support for some operations. |
| 282 | +This will be addressed in upcoming Keras releases as operation coverage is being expanded. |
| 283 | + |
| 284 | +--- |
| 285 | + |
260 | 286 | ## Moving from Keras 2 to Keras 3 |
261 | 287 |
|
262 | 288 | Keras 3 is highly backwards compatible with Keras 2: |
|
0 commit comments