Skip to content

Can't load LayerNormalization with RMS scaling #19806

@breuderink

Description

@breuderink

I can't load a model with a LayerNormalization layer with RMS scaling in Keras 3.3.3. I think this is a bug.

Here is a script to reproduce the issue:

import keras

model = keras.Sequential([keras.layers.LayerNormalization(rms_scaling=True)])
model.build((100, 10))
model.summary()

keras.models.save_model(model, '/tmp/test.keras')
model2 = keras.models.load_model('/tmp/test.keras')
# Fails with:
# Layer 'layer_normalization_5' expected 2 variables, but received 1 variables during loading. Expected: ['gamma', 'beta']

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions