Backend
Installation¶
Make sure to install the backend framework you want to use:
- TensorFlow.
- JAX.
- PyTorch.
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:
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:
- Export
KERAS_BACKEND
environment variable, i.e. to use JAX for training: - Edit your local config file at
~/.keras/keras.json
.
Tip
Usually training with JAX and TensorFlow is faster.