Skip to content

Backend

Installation

Make sure to install the backend framework you want to use:

Keras will automatically use the one selected via KERAS_BACKEND.

Example Using TensorFlow with GPU support

If you want to use TensorFlow with GPU support as the backend, install it with:

pip install tensorflow[and-cuda]

This ensures that the required CUDA libraries are included. For details, see TensorFlow GPU setup.


Keras Backend

To train the model, you can install the ML Framework you like the most. Keras 3 has support for TensorFlow, JAX and PyTorch backends.

To change the Keras backend you can either:

  1. Export KERAS_BACKEND environment variable, i.e. to use JAX for training:
    KERAS_BACKEND=tensorflow fast-plate-ocr train --config-file ...
    
  2. Edit your local config file at ~/.keras/keras.json.
Tip

Usually training with JAX and TensorFlow is faster.