NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1084 most downloaded on PyPI
Multi-backend Keras
Last release 2 months ago
29 Jul 2026
Ships fairly regularly
a new release about every 5 weeks
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
124 releases · first in 2015
Keras 3.15.1 is a patch release containing important security hardening, bug fixes, and Python 3.14 compatibility improvements.
Keras 3.15.1 is a patch release containing important security hardening, bug fixes, and Python 3.14 compatibility improvements.
np.load(allow_pickle=True) with a restricted unpickler that only permits numpy array reconstruction. (#23047) by @LinZiyuu.keras asset extraction path — Adds per-member decompression-ratio checks before extracting .keras archives to disk, preventing disk-exhaustion attacks via crafted archives. (#23101) by @LinZiyuucPickle.load in CIFAR-10/100 batch loading with the numpy-only RestrictedUnpickler, blocking arbitrary code execution via pickle gadgets. (#23252) by @SABITHSAHEB_load_state to capture weight store while preserving Keras test passing — Improves model loading efficiency by capturing the weight store into a local variable, and enhances nested container detection in legacy files with isolated failure tracking. (#23226) by @buildwithsuhanaTraceContext errors when using JAX NNX backend with models like T5 that lack a build method. Skips trace-level checks during symbolic shape inference and handles Flax 0.12 API changes. Fixes #23289. (#23326) by @divyashreepathihalliNotImplementedError boolean coercion changes in Python 3.14 and fixes dimension filtering in shape utilities. (#23259) by @hertschuhThank you to all the contributors who made this release possible! 🎉
.keras asset extraction (#23047, #23101)Full Changelog: https://github.com/keras-team/keras/compare/v3.15.0...v3.15.1
One column per quarter.
Keras-to-Torch Export : New export_torch enables exporting Keras models to native PyTorch nn.Module format, along with LiteRT (TFLite) export support
export_torch enables exporting Keras models to native PyTorch nn.Module format, along with LiteRT (TFLite) export support for the PyTorch backend.sliding_window parameter to MultiHeadAttention and GroupedQueryAttention for efficient long-context attention.MultiOptimizer supports assigning different optimizers to sub-networks.unique, pinv, matrix_rank, fabs, fmax, fmin, erfc, dsplit, percentile, nanpercentile, sobel_edges, and ssim (structural similarity) to keras.ops.unique, fabs, fmax, fmin, dsplit, erfc, percentile, nanpercentile in keras.ops.numpy.pinv (pseudo-inverse) and matrix_rank in keras.ops.linalg.sobel_edges for edge detection and ssim (structural similarity) in keras.ops.image.keras.ops.transpose now supports negative axis values.MultiHeadAttention and GroupedQueryAttention layers support the sliding_window parameter for efficient long-sequence processing.predict_proba method to SKLearnClassifier.nn.Module via model.export(..., format="torch").num_processes, num_model_replicas, data_shard_id).The OpenVINO backend received continued improvements:
glu, sparsemax, gaussian_blur, logdet, cholesky, lu_factor, erfc, segment_min, segment_prod, percentile, nanmedian, nanpercentile, unique, flash_attn, greedy ctc_decode, solve_triangular, compute_homography_matrix, and image transforms (affine, perspective, elastic).ExternalLink/SoftLink groups, virtual datasets, and shape-bomb datasets in model loading.np.load, fix insecure deserialization in dataset utilities, and make Lambda/TorchModuleWrapper from_config fail closed when safe_mode is unset.convert_to_tensor for Python scalars, divide_no_nan() NaN gradients, BiLSTM dispatch, lstsq with rcond, SymInt/SymFloat handling in convert_to_tensor and slice, and median for even-length inputs.tf.tensordot by removing redundant float casts.GroupNormalization with small epsilon; disabled autocast for mixed precision stability.BatchMatMulV2 gradient materialization.return_attention_scores.output_padding in Conv1D/2D/3DTranspose get_config.return_attention_scores flag in compute_output_spec; save seed in get_config.softmax, normalize, swapaxes, moveaxis, sort, argsort, cumsum, cumprod, take, stack, concatenate, split, diff, transpose, and more.compute_output_shape to work before build.from_config layers and avoid mutating input config.EarlyStopping/ReduceLROnPlateau resetting self.best between fit calls; fixed TensorBoard callback step counter never updating.tree.flatten and tree.map_structure for common cases.L1L2 regularizer.CITATION.cff for repository citation.We would like to thank our new contributors for making their first contribution to the Keras project:
Full Changelog: v3.14.0...v3.15.0
Harden path and link resolution when extracting files from archives
.keras files).ModelParallel (#22179)compile (#22663)
y_pred (as a list) and y_true (as a dict with keys matching Functional model output names) were not ordered identically and could be paired incorrectly.L1L2 regularizer (#22629)Full Changelog: v3.14.0...v3.14.1
Orbax Checkpoint Integration : Full support for Orbax checkpoints, including sharding, remote paths, and step recovery.
BatchRenormalization layer.ScheduleFreeAdamW optimizer.MultiHeadAttention and GroupedQueryAttention layers.nanmin, nanmax, nanmean, nanmedian, nanvar, nanstd, nanprod, nanargmin, nanargmax, and nanquantile in keras.ops.numpy.nextafter, ptp, view, sinc, fmod, i0, fliplr, flipud, rad2deg, geomspace, depth_to_space, space_to_depth, and fold.adapt() method, which allows the direct use of Grain datasets.The OpenVINO backend received a massive update, implementing a wide array of NumPy and Neural Network operations to achieve feature parity with other backends:
vander, trapezoid, corrcoef, correlate, flip, diagonal, cbrt, hypot, trace, kron, argpartition, logaddexp2, ldexp, select, round, vstack, hsplit, vsplit, tile, nansum, tensordot, exp2, trunc, gcd, unravel_index, inner, cumprod, searchsorted, hanning, diagflat, norm, histogram, lcm, allclose, real, imag, isreal, kaiser, shuffle, einsum, quantile, conj, randint, in_top_k, signbit, gamma, heaviside, var, std, inv, solve, cholesky_inverse, fft, fft2, ifft2, rfft, irfft, stft, istft, scatter, binomial, unfold, QR decomposition, view, and more.separable_conv, conv_transpose, adaptive_average_pool, adaptive_max_pool, RNN, LSTM, and GRU.cond, scan, associative_scan, map, switch, fori_loop, and vectorized_map.FlaxLayer and JaxLayer, variable jitting improvements, and direct JAX-to-ONNX export.Conv1DTranspose, IndexLookup, and TextVectorization.Sequential error messages for incompatible layers.sparse_categorical_crossentropy.We would like to thank our new contributors for making their first contribution to the Keras project:
Full Changelog: v3.13.2...v3.14.0
This release introduces critical security hardening for model loading and saving, alongside improvements to the JAX backend metadata handling.
This release introduces critical security hardening for model loading and saving, alongside improvements to the JAX backend metadata handling.
Disallow TFSMLayer deserialization in safe_mode (#22035)
TFSMLayer could load external TensorFlow SavedModels during deserialization without respecting Keras safe_mode. This could allow the execution of attacker-controlled graphs during model invocation.TFSMLayer now enforces safe_mode by default. Deserialization via from_config() will raise a ValueError unless safe_mode=False is explicitly passed or keras.config.enable_unsafe_deserialization() is called.Fix Denial of Service (DoS) in KerasFileEditor (#21880)
.keras file editor against malicious metadata that could cause dimension overflows or unbounded memory allocation (unbounded numpy allocation of multi-gigabyte tensors).Block External Links in HDF5 files (#22057)
mutable=True by default in nnx_metadata (#22074)
nnx_metadata.H5IOStore and ShardedH5IOStore to remove unused, unverified methods.We would like to thank the following contributors for their security reports and code improvements:
@0xManan, @HyperPS, @hertschuh, and @divyashreepathihalli.
Full Changelog: v3.13.1...v3.13.2
Removed a persistent warning triggered during import keras when using NumPy 2.0 or higher.
import keras when using NumPy 2.0 or higher. (#21949)Full Changelog: v3.13.0...v3.13.1
Starting with version 3.13.0, Keras now requires Python 3.11 or higher. Please ensure your environment is updated to Python 3.11+ to install the lates
Starting with version 3.13.0, Keras now requires Python 3.11 or higher. Please ensure your environment is updated to Python 3.11+ to install the latest version.
You can now export Keras models directly to the LiteRT format (formerly TensorFlow Lite) for on-device inference. This changes comes with improvements to input signature handling and export utility documentation. The changes ensure that LiteRT export is only available when TensorFlow is installed, update the export API and documentation, and enhance input signature inference for various model types.
Example:
import keras
import numpy as np
# 1. Define a simple model
model = keras.Sequential([
keras.layers.Input(shape=(10,)),
keras.layers.Dense(10, activation="relu"),
keras.layers.Dense(1, activation="sigmoid")
])
# 2. Compile and train (optional, but recommended before export)
model.compile(optimizer="adam", loss="binary_crossentropy")
model.fit(np.random.rand(100, 10), np.random.randint(0, 2, 100), epochs=1)
# 3. Export the model to LiteRT format
model.export("my_model.tflite", format="litert")
print("Model exported successfully to 'my_model.tflite' using LiteRT format.")
Introduced keras.quantizers.QuantizationConfig API that allows for customizable weight and activation quantizers, providing greater flexibility in defining quantization schemes.
Introduced a new filters argument to the Model.quantize method, allowing users to specify which layers should be quantized using regex strings, lists of regex strings, or a callable function. This provides fine-grained control over the quantization process.
Refactored the GPTQ quantization process to remove heuristic-based model structure detection. Instead, the model's quantization structure can now be explicitly provided via GPTQConfig or by overriding a new Model.get_quantization_layer_structure method, enhancing flexibility and robustness for diverse model architectures.
Core layers such as Dense, EinsumDense, Embedding, and ReversibleEmbedding have been updated to accept and utilize the new QuantizationConfig object, enabling fine-grained control over their quantization behavior.
Added a new method get_quantization_layer_structure to the Model class, intended for model authors to define the topology required for structure-aware quantization modes like GPTQ.
Introduced a new utility function should_quantize_layer to centralize the logic for determining if a layer should be quantized based on the provided filters.
Enabled the serialization and deserialization of QuantizationConfig objects within Keras layers, allowing quantized models to be saved and loaded correctly.
Modified the AbsMaxQuantizer to allow specifying the quantization axis dynamically during the __call__ method, rather than strictly defining it at initialization.
Example:
AbsMaxQuantizer to both weights and activations.model.quantize("int8")
None.from keras.quantizers import Int8QuantizationConfig, AbsMaxQuantizer
config = Int8QuantizationConfig(
weight_quantizer=AbsMaxQuantizer(axis=0),
activation_quantizer=None
)
model.quantize(config=config)
config = Int8QuantizationConfig(
# Restrict range for symmetric quantization
weight_quantizer=AbsMaxQuantizer(axis=0, value_range=(-127, 127)),
activation_quantizer=AbsMaxQuantizer(axis=-1, value_range=(-127, 127))
)
model.quantize(config=config)
Added adaptive pooling operations keras.ops.nn.adaptive_average_pool and keras.ops.nn.adaptive_max_pool for 1D, 2D, and 3D inputs. These operations transform inputs of varying spatial dimensions into a fixed target shape defined by output_size by dynamically inferring the required kernel size and stride. Added corresponding layers:
keras.layers.AdaptiveAveragePooling1Dkeras.layers.AdaptiveAveragePooling2Dkeras.layers.AdaptiveAveragePooling3Dkeras.layers.AdaptiveMaxPooling1Dkeras.layers.AdaptiveMaxPooling2Dkeras.layers.AdaptiveMaxPooling3Dkeras.ops.numpy.array_splitop a fundamental building block for tensor parallelism.keras.ops.numpy.empty_like op.keras.ops.numpy.ldexp op.keras.ops.numpy.vander op which constructs a Vandermonde matrix from a 1-D input tensor.keras.distribution.get_device_count utility function for distribution API.keras.layers.JaxLayer and keras.layers.FlaxLayer now support the TensorFlow backend in addition to the JAX backed. This allows you to embed flax.linen.Module instances or JAX functions in your model. The TensorFlow support is based on jax2tf.OpenVINO Backend Support:
numpy.digitize support.numpy.diag support.numpy.isin support.numpy.vdot support.numpy.floor_divide support.numpy.roll support.numpy.multi_hot support.numpy.psnr support.numpy.empty_like support.attention_axes for MultiHeadAttention layers.Softmax mask handling, aimed at improving numerical robustness, was based on a deep investigation led by Jaswanth Sreeram, who prototyped the solution with contributions from others.Normalization layer's adapt method now supports PyDataset objects, allowing for proper adaptation when using this data type.Configured the TPU testing infrastructure to enforce unit test coverage across the entire codebase. This ensures that both existing logic and all future contributions are validated for functionality and correctness within the TPU environment.
Full Changelog: https://github.com/keras-team/keras/compare/v3.12.0...v3.13.0
Keras 3.12.4 is a security patch release that hardens dataset loading and model file handling against insecure deserialization and decompression-bomb
Keras 3.12.4 is a security patch release that hardens dataset loading and model file handling against insecure deserialization and decompression-bomb attacks.
np.load(allow_pickle=True) with a restricted unpickler that only permits numpy array reconstruction, preventing arbitrary code execution via crafted .npz files (CWE-502). (#23047) by @LinZiyuu.keras asset extraction path — Adds per-member decompression-ratio checks before extracting .keras archives to disk, preventing disk-exhaustion attacks via crafted archives. (#23101) by @LinZiyuucPickle.load in CIFAR-10/100 batch loading with the numpy-only RestrictedUnpickler, blocking arbitrary code execution via pickle gadgets. (#23252) by @SABITHSAHEBThank you to all the contributors who made this release possible! 🎉
.keras asset extraction (#23047, #23101)Full Changelog: https://github.com/keras-team/keras/compare/v3.12.3...v3.12.4
Keras 3.12.3 is a security patch release that hardens model saving, loading, and deserialization against a range of attack vectors.
Keras 3.12.3 is a security patch release that hardens model saving, loading, and deserialization against a range of attack vectors.
.h5 dispatcher (#22900)
load_weights path for .h5 files.load_model/load_weights..keras archive members that declare far more data than is actually stored, preventing memory exhaustion.realpath to prevent symlink-based directory traversal attacks.filter="data" in TarFile.extractall (#23108)
np.load (#23034)
from_config fail closed (#23048)
safe_mode is unset, Lambda and TorchModuleWrapper deserialization now fails closed instead of silently allowing arbitrary code execution.Full Changelog: v3.12.2...v3.12.3
Remove deprecated openvino.runtime import
.keras files).h5py
h5py to ensure correct and safe validation behavior when the package is lazy-loaded.openvino.runtime import (#21826)Full Changelog: v3.12.1...v3.12.2
Special thanks to the security researchers and contributors who reported these vulnerabilities and helped implement the fixes: @0xManan, @HyperPS , an…
This release introduces critical security hardening for model loading and saving, alongside improvements to the JAX backend metadata handling.
Disallow TFSMLayer deserialization in safe_mode (#22035)
TFSMLayer could load external TensorFlow SavedModels during deserialization without respecting Keras safe_mode. This could allow the execution of attacker-controlled graphs during model invocation.TFSMLayer now enforces safe_mode by default. Deserialization via from_config() will raise a ValueError unless safe_mode=False is explicitly passed or keras.config.enable_unsafe_deserialization() is called.Fix Denial of Service (DoS) in KerasFileEditor (#21880)
.keras file editor against malicious metadata that could cause dimension overflows or unbounded memory allocation (unbounded numpy allocation of multi-gigabyte tensors).Block External Links in HDF5 files (#22057)
H5IOStore and ShardedH5IOStore to remove unused, unverified methods.Special thanks to the security researchers and contributors who reported these vulnerabilities and helped implement the fixes: @0xManan, @HyperPS, and @hertschuh.
Full Changelog: v3.12.0...v3.12.1
Fix two vulnerabilities related to adversarial saved files loaded with safe_mode: CVE-2025-12058 and CVE-2025-12060.
You now have access to an easy-to-use API for distilling large models into small models while minimizing performance drop on a reference dataset -- compatible with all existing Keras models. You can specify a range of different distillation losses, or create your own losses. The API supports multiple concurrent distillation losses at the same time.
Example:
# Load a model to distill
teacher = ...
# This is the model we want to distill it into
student = ...
# Configure the process
distiller = Distiller(
teacher=teacher,
student=student,
distillation_losses=LogitsDistillation(temperature=3.0),
)
distiller.compile(
optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy']
)
# Train the distilled model
distiller.fit(x_train, y_train, epochs=10)
GPTQ is now built into the Keras API. GPTQ is a post-training, weights-only quantization method that compresses a model to int4 layer by layer. For each layer, it uses a second-order method to update weights while minimizing the error on a calibration dataset.
Learn how to use it in this guide.
Example:
model = keras_hub.models.Gemma3CausalLM.from_preset("gemma3_1b")
gptq_config = keras.quantizers.GPTQConfig(
dataset=calibration_dataset,
tokenizer=model.preprocessor.tokenizer,
weight_bits=4,
group_size=128,
num_samples=256,
sequence_length=256,
hessian_damping=0.01,
symmetric=False,
activation_order=False,
)
model.quantize("gptq", config=gptq_config)
outputs = model.generate(prompt, max_length=30)
keras.utils.image_dataset_from_directory and keras.utils.text_dataset_from_directory. Specify format="grain" to return a Grain dataset instead of a TF dataset.keras.layers.ReversibleEmbedding layer: an embedding layer that can also also project backwards to the input space. Use it with the reverse argument in call().opset_version in model.export(). Argument specific to format="onnx"; specifies the ONNX opset version.keras.ops.isin op.keras.ops.isneginf, keras.ops.isposinf ops.keras.ops.isreal op.keras.ops.cholesky_inverse op and add upper argument in keras.ops.cholesky.keras.ops.image.scale_and_translate op.keras.ops.hypot op.keras.ops.gcd op.keras.ops.kron op.keras.ops.logaddexp2 op.keras.ops.view op.keras.ops.unfold op.keras.ops.jvp op.keras.ops.trapezoid op.StringLookup & IntegerLookup now save vocabulary loaded from file. Previously, when instantiating these layers from a vocabulary filepath, only the filepath would be saved when saving the layer. Now, the entire vocabulary is materialized and saved as part of the .keras archive.safe_mode: CVE-2025-12058 and CVE-2025-12060.Full Changelog: https://github.com/keras-team/keras/compare/v3.11.0...v3.12.0
Version bump to 3.11.3 by @rtg0795 in https://github.com/keras-team/keras/pull/21607
Full Changelog: https://github.com/keras-team/keras/compare/v3.11.2...v3.11.3
Version bump 3.11.2 and nnx fix #21565 by @laxmareddyp in https://github.com/keras-team/keras/pull/21570
Full Changelog: https://github.com/keras-team/keras/compare/v3.11.1...v3.11.2
Version bump 3.11.1 by @rtg0795 in https://github.com/keras-team/keras/pull/21535
Full Changelog: https://github.com/keras-team/keras/compare/v3.11.0...v3.11.1
Support Grain data loaders in fit()/evaluate()/predict().
fit()/evaluate()/predict().keras.ops.kaiser function.keras.ops.hanning function.keras.ops.cbrt function.keras.ops.deg2rad function.keras.ops.layer_normalization function to leverage backend-specific performance optimizations.Flatten layer.Full Changelog: https://github.com/keras-team/keras/compare/v3.10.0...v3.11.0
Add support for weight sharding for saving very large models with model.save(). It is controlled via the max_shard_size argument. Specifying this argu
model.save(). It is controlled via the max_shard_size argument. Specifying this argument will split your Keras model weight file into chunks of this size at most. Use load_model() to reload the sharded files.keras.optimizers.Muonkeras.layers.RandomElasticTransformkeras.losses.CategoricalGeneralizedCrossEntropy (with functional version keras.losses.categorical_generalized_cross_entropy)axis argument to SparseCategoricalCrossentropylora_alpha to all LoRA-enabled layers. If set, this parameter scales the low-rank adaptation delta during the forward pass.keras.activations.sparse_sigmoidkeras.ops.image.elastic_transformkeras.ops.anglekeras.ops.bartlettkeras.ops.blackmankeras.ops.hammingkeras.ops.view_as_complex, keras.ops.view_as_realtf.RaggedTensor support to Embedding layersynchronization argumentFull Changelog: https://github.com/keras-team/keras/compare/v3.9.0...v3.10.0
Fix Remat error when called with a model.
Full Changelog: https://github.com/keras-team/keras/compare/v3.9.1...v3.9.2
Fix incorrect argument in JAX flash attention.
Full Changelog: https://github.com/keras-team/keras/compare/v3.9.0...v3.9.1
Security fix: disallow object pickling in saved npz model files (numpy format). Thanks to Peng Zhou for reporting the vulnerability.
keras.RematScope and keras.remat. It can be used to turn on rematerizaliation for certain layers in fine-grained manner, e.g. only for layers larger than a certain size, or for a specific set of layers, or only for activations.keras.ops.rot90keras.ops.rearrange (Einops-style)keras.ops.signbitkeras.ops.polarkeras.ops.image.perspective_transformkeras.ops.image.gaussian_blurkeras.layers.RMSNormalizationkeras.layers.AugMixkeras.layers.CutMixkeras.layers.RandomInvertkeras.layers.RandomErasingkeras.layers.RandomGaussianBlurkeras.layers.RandomPerspectivedtype argument to JaxLayer and FlaxLayer layersBinaryAccuracy metricantialias argument to keras.layers.Resizing layer.npz model files (numpy format). Thanks to Peng Zhou for reporting the vulnerability.Full Changelog: https://github.com/keras-team/keras/compare/v3.8.0...v3.9.0
OpenVINO is now available as an infererence-only Keras backend. You can start using it by setting the backend field to "openvino" in your keras.json c
OpenVINO is now available as an infererence-only Keras backend. You can start using it by setting the backend field to "openvino" in your keras.json config file.
OpenVINO is a deep learning inference-only framework tailored for CPU (x86, ARM), certain GPUs (OpenCL capable, integrated and discrete) and certain AI accelerators (Intel NPU).
Because OpenVINO does not support gradients, you cannot use it for training (e.g. model.fit()) -- only inference. You can train your models with the JAX/TensorFlow/PyTorch backends, and when trained, reload them with the OpenVINO backend for inference on a target device supported by OpenVINO.
You can now export your Keras models to the ONNX format from the JAX, TensorFlow, and PyTorch backends.
Just pass format="onnx" in your model.export() call:
# Export the model as a ONNX artifact
model.export("path/to/location", format="onnx")
# Load the artifact in a different process/environment
ort_session = onnxruntime.InferenceSession("path/to/location")
# Run inference
ort_inputs = {
k.name: v for k, v in zip(ort_session.get_inputs(), input_data)
}
predictions = ort_session.run(None, ort_inputs)
It's now possible to easily integrate Keras models into Sciki-Learn pipelines! The following wrapper classes are available:
keras.wrappers.SKLearnClassifier: implements the sklearn Classifier APIkeras.wrappers.SKLearnRegressor: implements the sklearn Regressor APIkeras.wrappers.SKLearnTransformer: implements the sklearn Transformer APIkeras.ops.diagflatkeras.ops.unravel_indexsparse_plus activationsparsemax activationkeras.layers.RandAugmentkeras.layers.Equalizationkeras.layers.MixUpkeras.layers.RandomHuekeras.layers.RandomGrayscalekeras.layers.RandomSaturationkeras.layers.RandomColorJitterkeras.layers.RandomColorDegenerationkeras.layers.RandomSharpnesskeras.layers.RandomShearaxis to tversky losskeras.random.shuffle XLA compilablemodel.export() and keras.export.ExportArchive with the PyTorch backend, supporting both the TF SavedModel format and the ONNX format.Full Changelog: https://github.com/keras-team/keras/compare/v3.7.0...v3.8.0
Add flash_attention argument to keras.ops.dot_product_attention and to keras.layers.MultiHeadAttention.
flash_attention argument to keras.ops.dot_product_attention and to keras.layers.MultiHeadAttention.keras.layers.STFTSpectrogram layer (to extract STFT spectrograms from inputs as a preprocessing step) as well as its initializer keras.initializers.STFTInitializer.celu, glu, log_sigmoid, hard_tanh, hard_shrink, squareplus activations.keras.losses.Circle loss.keras.visualization.draw_bounding_boxes, keras.visualization.draw_segmentation_masks, keras.visualization.plot_image_gallery, keras.visualization.plot_segmentation_mask_gallery.double_checkpoint argument to BackupAndRestore to save a fallback checkpoint in case the first checkpoint gets corrupted.CenterCrop, RandomFlip, RandomZoom, RandomTranslation, RandomCrop.keras.ops.exp2, keras.ops.inner operations.bias_add.Full Changelog: https://github.com/keras-team/keras/compare/v3.6.0...v3.7.0
New file editor utility: keras.saving.KerasFileEditor. Use it to inspect, diff, modify and resave Keras weights files. See basic workflow here.
keras.saving.KerasFileEditor. Use it to inspect, diff, modify and resave Keras weights files. See basic workflow here.keras.utils.Config class for managing experiment config parameters.keras.utils.get_file, with extract=True or untar=True, the return value will be the path of the extracted directory, rather than the path of the archive.fit(), evaluate(), predict(). This enables 100% compact stacking of train_step calls on accelerators (e.g. when running small models on TPU).
on_batch_end, this will disable async logging. You can force it back by adding self.async_safe = True to your callbacks. Note that the TensorBoard callback isn't considered async safe by default. Default callbacks like the progress bar are async safe.keras.saving.KerasFileEditor utility to inspect, diff, modify and resave Keras weights file.keras.utils.Config class. It behaves like a dictionary, with a few nice features:
config.foo = 2 or config["foo"] are both valid)config.to_json().config.freeze().bitwise_andbitwise_invertbitwise_left_shiftbitwise_notbitwise_orbitwise_right_shiftbitwise_xorkeras.ops.logdet.keras.ops.trunc.keras.ops.dot_product_attention.keras.ops.histogram.PyDataset instances to use multithreading.verbose in keras.saving.ExportArchive.write_out() method for exporting TF SavedModel.epsilon argument in keras.ops.normalize.Model.get_state_tree() method for retrieving a nested dict mapping variable paths to variable values (either as numpy arrays or backend tensors (default)). This is useful for rolling out custom JAX training loops.keras.layers.AutoContrast, keras.layers.Solarization.keras.layers.Pipeline class, to apply a sequence of layers to an input. This class is useful to build a preprocessing pipeline. Compared to a Sequential model, Pipeline features a few important differences:
Model, just a plain layer.tf.data, the pipeline will also remain tf.data compatible, independently of the backend you use.Full Changelog: https://github.com/keras-team/keras/compare/v3.5.0...v3.6.0
Add integration with the Hugging Face Hub. You can now save models to Hugging Face Hub directly from keras.Model.save() and load .keras models directl
keras.Model.save() and load .keras models directly from Hugging Face Hub with keras.saving.load_model().keras.optimizers.Lamb optimizer.keras.distribution API support for very large models.keras.ops.associative_scan op.keras.ops.searchsorted op.keras.utils.PyDataset.on_epoch_begin() method.data_format argument to keras.layers.ZeroPadding1D layer.Full Changelog: https://github.com/keras-team/keras/compare/v3.4.1...v3.5.0
This is a minor bugfix release.
This is a minor bugfix release.
Add support for arbitrary, deeply nested input/output structures in Functional models (e.g. dicts of dicts of lists of inputs or outputs...)
keras.dtype_policies.DTypePolicyMap for easy configuration of dtype policies of nested sublayers of a subclassed layer/model.keras.ops.argpartitionkeras.ops.scankeras.ops.lstsqkeras.ops.switchkeras.ops.dtypekeras.ops.mapkeras.ops.image.rgb_to_hsvkeras.ops.image.hsv_to_rgbfloat8 inference for Dense and EinsumDense layers.name argument in all Keras Applications models.axis argument in keras.losses.Dice.keras.utils.FeatureSpace to be used in a tf.data pipeline even when the backend isn't TensorFlow.StringLookup layer can now take tf.SparseTensor as input.Metric.variables is now recursive.training argument to Model.compute_loss().dtype argument to all losses.keras.utils.split_dataset now supports nested structures in dataset.Full Changelog: https://github.com/keras-team/keras/compare/v3.3.3...v3.4.0
This is a minor bugfix release.
This is a minor bugfix release.
This is a simple fix release that re-surfaces legacy Keras 2 APIs that aren't part of Keras package proper, but that are still featured in tf.keras. N
This is a simple fix release that re-surfaces legacy Keras 2 APIs that aren't part of Keras package proper, but that are still featured in tf.keras. No other content has changed.
This is a simple fix release that moves the legacy _tf_keras API directory to the root of the Keras pip package. This is done in order to preserve imp
This is a simple fix release that moves the legacy _tf_keras API directory to the root of the Keras pip package. This is done in order to preserve import paths like from tensorflow.keras import layers without making any changes to the TensorFlow API files.
No other content has changed.
Add keras.ops.ctc_decode for JAX and TensorFlow.
keras.ops.ctc_decode for JAX and TensorFlow.keras.ops.vectorize, keras.ops.select.keras.ops.image.rgb_to_grayscale.keras.losses.Tversky loss.bincount and digitize sparse support.In addition, the codebase structure has evolved:
keras/src/.keras/api/.pip install Keras directly from the GitHub sources.Full Changelog: https://github.com/keras-team/keras/compare/v3.2.1...v3.3.0
This is a minor bugfix release.
This is a minor bugfix release.
Full Changelog: https://github.com/keras-team/keras/compare/v3.2.0...v3.2.1
Introduce QLoRA-like technique for LoRA fine-tuning of Dense and EinsumDense layers (thereby any LLM) in int8 precision.
Dense and EinsumDense layers (thereby any LLM) in int8 precision.keras.ops.custom_gradient support to PyTorch.keras.layers.JaxLayer and keras.layers.FlaxLayer to wrap JAX/Flax modules as Keras layers.save_model & load_model to accept a file-like object.Embedding layer.compute_loss method with all backends.self.losses inside a custom compute_loss method with the JAX backend.keras.losses.Dice loss.keras.ops.correlate.model.export(): add support for aliases, finer control over jax2tf options, and dynamic batch shapes.Full Changelog: https://github.com/keras-team/keras/compare/v3.1.1...v3.2.0
This is a minor bugfix release over 3.1.0.
This is a minor bugfix release over 3.1.0.
draw_seed causing device discrepancy issue during torch's symbolic execution by @KhawajaAbaid in https://github.com/keras-team/keras/pull/19289keras.ops.softmax for the tensorflow backend by @tirthasheshpatel in https://github.com/keras-team/keras/pull/19300scatter_update in optimizers. by @hertschuh in https://github.com/keras-team/keras/pull/19313dm-tree with optree by @james77777778 in https://github.com/keras-team/keras/pull/19306tf.Datasets to have different dimensions. by @hertschuh in https://github.com/keras-team/keras/pull/19318Full Changelog: https://github.com/keras-team/keras/compare/v3.1.0...v3.1.1
Add support for int8 inference. Just call model.quantize("int8") to do an in-place conversion of a bfloat16 or float32 model to an int8 model. Note th
int8 inference. Just call model.quantize("int8") to do an in-place conversion of a bfloat16 or float32 model to an int8 model. Note that only Dense and EinsumDense layers will be converted (this covers LLMs and all Transformers in general). We may add more supported layers over time.keras.config.set_backend(backend) utility to reload a different backend.keras.layers.MelSpectrogram layer for turning raw audio data into Mel spectrogram representation.keras.ops.custom_gradient decorator (only for JAX and TensorFlow).keras.ops.image.crop_images.pad_to_aspect_ratio argument to image_dataset_from_directory.keras.random.binomial and keras.random.beta functions.keras.ops.einsum to run with int8 x int8 inputs and int32 output.verbose argument in all dataset-creation utilities.SpectralNormalizationaxis logic across all backends and add support for multiple axes in expand_dims and squeezeFull Changelog: https://github.com/keras-team/keras/compare/v3.0.5...v3.1.0
This release brings many bug fixes and performance improvements, new linear algebra ops, and sparse tensor support for the JAX backend.
This release brings many bug fixes and performance improvements, new linear algebra ops, and sparse tensor support for the JAX backend.
keras.ops.linalg.while_loop op.erfinv op.normalize op.IterableDataset to TorchDataLoaderAdapter.Full Changelog: https://github.com/keras-team/keras/compare/v3.0.4...v3.0.5
This is a minor release with improvements to the LoRA API required by the next release of KerasNLP.
This is a minor release with improvements to the LoRA API required by the next release of KerasNLP.
Full Changelog: https://github.com/keras-team/keras/compare/v3.0.3...v3.0.4
Add built-in LoRA (low-rank adaptation) API to all relevant layers (Dense, EinsumDense, Embedding).
This is a minor Keras release.
Dense, EinsumDense, Embedding).SwapEMAWeights callback to make it easier to evaluate model metrics using EMA weights during training.DataAdapters now create a native iterator for each backend, improving performance.bfloat16 dtype is now allowed in the global set_dtype configuration utility.Full Changelog: https://github.com/keras-team/keras/compare/v3.0.2...v3.0.3
There are no known breaking changes in this release compared to 3.0.1.
There are no known breaking changes in this release compared to 3.0.1.
keras.random.binomial and keras.random.beta RNG functions.BatchNormalization.keras.losses.CTC (loss function for sequence-to-sequence tasks) as well as the lower-level operation keras.ops.ctc_loss.ops.random.alpha_dropout and layers.AlphaDropout.Full Changelog: https://github.com/keras-team/keras/compare/v3.0.1...v3.0.2
This is a minor release focused on bug fixes and performance improvements.
This is a minor release focused on bug fixes and performance improvements.
stop_evaluating and stop_predicting model attributes for callbacks, similar to stop_training.keras.device() scope for managing device placement in a multi-backend way.PyDataset.hard_swish activation and op.force_download arg to get_file to force cache invalidation.Full Changelog: https://github.com/keras-team/keras/compare/v3.0.0...v3.0.1
See this thread for a complete list of breaking changes, as well as the Keras 3 migration guide.
See the release announcement for a detailed list of major changes. Main highlights compared to Keras 2 are:
keras.ops API for building cross-framework components.keras.distribution based on JAX.See this thread for a complete list of breaking changes, as well as the Keras 3 migration guide.
Typofixes for StringLookup documentation by @cw118 in https://github.com/keras-team/keras/pull/18333
StringLookup documentation by @cw118 in https://github.com/keras-team/keras/pull/18333compile_from_config(). by @nkovela1 in https://github.com/keras-team/keras/pull/18492Full Changelog: https://github.com/keras-team/keras/compare/v2.14.0...v2.15.0
Nothing published for this version
Nothing published for this version
[keras/layers/normalization] Standardise docstring usage of "Default to" by @SamuelMarks in https://github.com/keras-team/keras/pull/17965
is None checks on measure_performance by @SamuelMarks in https://github.com/keras-team/keras/pull/17980Full Changelog: https://github.com/keras-team/keras/compare/v2.13.1...v2.14.0
[keras/layers/normalization] Standardise docstring usage of "Default to" by @SamuelMarks in https://github.com/keras-team/keras/pull/17965
is None checks on measure_performance by @SamuelMarks in https://github.com/keras-team/keras/pull/17980Full Changelog: https://github.com/keras-team/keras/compare/v2.13.1...v2.14.0-rc0
Fix timeseries_dataset_from_array counts when sequence_stride > 1 by @basjacobs93 in https://github.com/keras-team/keras/pull/17396
Full Changelog: https://github.com/keras-team/keras/compare/v2.12.0...v2.13.1
Cherrypick Sequential serialization bug fix for r2.13 by @nkovela1 in https://github.com/keras-team/keras/pull/18258
Full Changelog: https://github.com/keras-team/keras/compare/v2.13.1-rc0...v2.13.1-rc1
Fix timeseries_dataset_from_array counts when sequence_stride > 1 by @basjacobs93 in https://github.com/keras-team/keras/pull/17396
Full Changelog: https://github.com/keras-team/keras/compare/v2.12.0...v2.13.1-rc0
Update deprecated tf.contrib by @sachinprasadhs in https://github.com/keras-team/keras/pull/17344
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.12.0 for more details.
amsgrad argument in SGD by @lgeiger in https://github.com/keras-team/keras/pull/17197finalize_variable_values in LossScaleOptimizerV3 by @lgeiger in https://github.com/keras-team/keras/pull/17225use_causal_mask=True with RaggedTensor bug by @haifeng-jin in https://github.com/keras-team/keras/pull/17231to_ordinal feature for ordinal regression/classification by @awsaf49 in https://github.com/keras-team/keras/pull/17419to_ordinal by @awsaf49 in https://github.com/keras-team/keras/pull/17485Full Changelog: https://github.com/keras-team/keras/compare/v2.11.0...v2.12.0
Update deprecated tf.contrib by @sachinprasadhs in https://github.com/keras-team/keras/pull/17344
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.12.0-rc0 for more details.
amsgrad argument in SGD by @lgeiger in https://github.com/keras-team/keras/pull/17197finalize_variable_values in LossScaleOptimizerV3 by @lgeiger in https://github.com/keras-team/keras/pull/17225use_causal_mask=True with RaggedTensor bug by @haifeng-jin in https://github.com/keras-team/keras/pull/17231to_ordinal feature for ordinal regression/classification by @awsaf49 in https://github.com/keras-team/keras/pull/17419to_ordinal by @awsaf49 in https://github.com/keras-team/keras/pull/17485Full Changelog: https://github.com/keras-team/keras/compare/v2.11.0...v2.12.0-rc1
Nothing published for this version
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.11.0 for more details.
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.11.0 for more details.
Full Changelog: https://github.com/keras-team/keras/compare/v2.10.0...v2.11.0
Cherrypick pull request #17225 from lgeiger:fix-mixed-precision-ema by @qlzh727 in https://github.com/keras-team/keras/pull/17226
Full Changelog: https://github.com/keras-team/keras/compare/v2.11.0-rc2...v2.11.0-rc3
Cherrypick for cl/482011499: Throw error on deprecated fields. by @qlzh727 in https://github.com/keras-team/keras/pull/17179
Full Changelog: https://github.com/keras-team/keras/compare/v2.11.0-rc1...v2.11.0-rc2
Fix usage of deprecated Pillow interpolation methods by @neoaggelos in https://github.com/keras-team/keras/pull/16746
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.11.0-rc1 for more details.
exclude_from_weight_decay to AdamW by @markub3327 in https://github.com/keras-team/keras/pull/16274reset_states not working when invoked within a tf.function in graph mode. by @copybara-service in https://github.com/keras-team/keras/pull/16400f prefix on f-strings fix by @code-review-doctor in https://github.com/keras-team/keras/pull/16459AutoShardPolicy.DATA for TensorLike datasets by @lgeiger in https://github.com/keras-team/keras/pull/16604is_legacy_optimizer to optimizer config to keep saving/loading consistent. by @copybara-service in https://github.com/keras-team/keras/pull/16842tf.keras.preprocessing.image* to tf.keras.utils* by @chunduriv in https://github.com/keras-team/keras/pull/16864distribute_reduction_method in Model. by @kretes in https://github.com/keras-team/keras/pull/16664metrics parameter in compile by @matangover in https://github.com/keras-team/keras/pull/16893Returns section in compute_output_shape by @chunduriv in https://github.com/keras-team/keras/pull/16955Full Changelog: https://github.com/keras-team/keras/compare/v2.10.0...v2.11.0-rc1
Nothing published for this version
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.10.0 for more details.
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.10.0 for more details.
Full Changelog: https://github.com/keras-team/keras/compare/v2.9.0...v2.10.0
Fix usage of deprecated Pillow interpolation methods by @neoaggelos in https://github.com/keras-team/keras/pull/16746
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.10.0-rc3 for more details.
exclude_from_weight_decay to AdamW by @markub3327 in https://github.com/keras-team/keras/pull/16274reset_states not working when invoked within a tf.function in graph mode. by @copybara-service in https://github.com/keras-team/keras/pull/16400f prefix on f-strings fix by @code-review-doctor in https://github.com/keras-team/keras/pull/16459AutoShardPolicy.DATA for TensorLike datasets by @lgeiger in https://github.com/keras-team/keras/pull/16604is_legacy_optimizer to optimizer config to keep saving/loading consistent. by @copybara-service in https://github.com/keras-team/keras/pull/16842is_legacy_optimizer to optimizer config to keep saving/loading … by @qlzh727 in https://github.com/keras-team/keras/pull/16856Full Changelog: https://github.com/keras-team/keras/compare/v2.9.0-rc0...v2.10.0-rc1
Nothing published for this version
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.9.0 for more details.
Please see the release history at https://github.com/tensorflow/tensorflow/releases/tag/v2.9.0 for more details.
Full Changelog: https://github.com/keras-team/keras/compare/v2.8.0...v2.9.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →