Update dependency keras to v3.9.0 [SECURITY] #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==3.3.2
->==3.9.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2025-1550
Impact
The Keras
Model.load_model
function permits arbitrary code execution, even withsafe_mode=True
, through a manually constructed, malicious.keras
archive. By altering theconfig.json
file within the archive, an attacker can specify arbitrary Python modules and functions, along with their arguments, to be loaded and executed during model loading.Patches
This problem is fixed starting with version
3.9
.Workarounds
Only load models from trusted sources and model archives created with Keras.
References
Release Notes
keras-team/keras (keras)
v3.9.0
: Keras 3.9.0Compare Source
New features
keras.RematScope
andkeras.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.rot90
keras.ops.rearrange
(Einops-style)keras.ops.signbit
keras.ops.polar
keras.ops.image.perspective_transform
keras.ops.image.gaussian_blur
keras.layers.RMSNormalization
keras.layers.AugMix
keras.layers.CutMix
keras.layers.RandomInvert
keras.layers.RandomErasing
keras.layers.RandomGaussianBlur
keras.layers.RandomPerspective
dtype
argument toJaxLayer
andFlaxLayer
layersBinaryAccuracy
metricantialias
argument tokeras.layers.Resizing
layer.npz
model files (numpy format). Thanks to Peng Zhou for reporting the vulnerability.New Contributors
Full Changelog: keras-team/keras@v3.8.0...v3.9.0
v3.8.0
: Keras 3.8.0Compare Source
New: OpenVINO backend
OpenVINO is now available as an infererence-only Keras backend. You can start using it by setting the
backend
field to"openvino"
in yourkeras.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.New: ONNX model export
You can now export your Keras models to the ONNX format from the JAX, TensorFlow, and PyTorch backends.
Just pass
format="onnx"
in yourmodel.export()
call:New: Scikit-Learn API compatibility interface
It's now possible to easily integrate Keras models into Sciki-Learn pipelines! The following wrapper classes are available:
keras.wrappers.SKLearnClassifier
: implements the sklearnClassifier
APIkeras.wrappers.SKLearnRegressor
: implements the sklearnRegressor
APIkeras.wrappers.SKLearnTransformer
: implements the sklearnTransformer
APIOther feature additions
keras.ops.diagflat
keras.ops.unravel_index
sparse_plus
activationsparsemax
activationkeras.layers.RandAugment
keras.layers.Equalization
keras.layers.MixUp
keras.layers.RandomHue
keras.layers.RandomGrayscale
keras.layers.RandomSaturation
keras.layers.RandomColorJitter
keras.layers.RandomColorDegeneration
keras.layers.RandomSharpness
keras.layers.RandomShear
axis
totversky
lossJAX specific changes
TensorFlow specific changes
keras.random.shuffle
XLA compilablePyTorch specific changes
model.export()
andkeras.export.ExportArchive
with the PyTorch backend, supporting both the TF SavedModel format and the ONNX format.New Contributors
Full Changelog: keras-team/keras@v3.7.0...v3.8.0
v3.7.0
: Keras 3.7.0Compare Source
API changes
flash_attention
argument tokeras.ops.dot_product_attention
and tokeras.layers.MultiHeadAttention
.keras.layers.STFTSpectrogram
layer (to extract STFT spectrograms from inputs as a preprocessing step) as well as its initializerkeras.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 toBackupAndRestore
to save a fallback checkpoint in case the first checkpoint gets corrupted.CenterCrop
,RandomFlip
,RandomZoom
,RandomTranslation
,RandomCrop
.keras.ops.exp2
,keras.ops.inner
operations.Performance improvements
bias_add
.New Contributors
Full Changelog: keras-team/keras@v3.6.0...v3.7.0
v3.6.0
: Keras 3.6.0Compare Source
Highlights
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.BREAKING changes
keras.utils.get_file
, withextract=True
oruntar=True
, the return value will be the path of the extracted directory, rather than the path of the archive.Other changes and additions
fit()
,evaluate()
,predict()
. This enables 100% compact stacking oftrain_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 addingself.async_safe = True
to your callbacks. Note that theTensorBoard
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
orconfig["foo"]
are both valid)config.to_json()
.config.freeze()
.bitwise_and
bitwise_invert
bitwise_left_shift
bitwise_not
bitwise_or
bitwise_right_shift
bitwise_xor
keras.ops.logdet
.keras.ops.trunc
.keras.ops.dot_product_attention
.keras.ops.histogram
.PyDataset
instances to use multithreading.verbose
inkeras.saving.ExportArchive.write_out()
method for exporting TF SavedModel.epsilon
argument inkeras.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 aSequential
model,Pipeline
features a few important differences:Model
, just a plain layer.tf.data
, the pipeline will also remaintf.data
compatible, independently of the backend you use.New Contributors
Full Changelog: keras-team/keras@v3.5.0...v3.6.0
v3.5.0
: Keras 3.5.0Compare Source
What's Changed
keras.Model.save()
and load.keras
models directly from Hugging Face Hub withkeras.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 tokeras.layers.ZeroPadding1D
layer.Full Changelog: keras-team/keras@v3.4.1...v3.5.0
v3.4.1
: Keras 3.4.1Compare Source
This is a minor bugfix release.
v3.4.0
: Keras 3.4.0Compare Source
Highlights
keras.dtype_policies.DTypePolicyMap
for easy configuration of dtype policies of nested sublayers of a subclassed layer/model.keras.ops.argpartition
keras.ops.scan
keras.ops.lstsq
keras.ops.switch
keras.ops.dtype
keras.ops.map
keras.ops.image.rgb_to_hsv
keras.ops.image.hsv_to_rgb
What's changed
float8
inference forDense
andEinsumDense
layers.name
argument in all Keras Applications models.axis
argument inkeras.losses.Dice
.keras.utils.FeatureSpace
to be used in atf.data
pipeline even when the backend isn't TensorFlow.StringLookup
layer can now taketf.SparseTensor
as input.Metric.variables
is now recursive.training
argument toModel.compute_loss()
.dtype
argument to all losses.keras.utils.split_dataset
now supports nested structures in dataset.Full Changelog: keras-team/keras@v3.3.3...v3.4.0
v3.3.3
: Keras 3.3.3Compare Source
This is a minor bugfix release.
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.