-
Notifications
You must be signed in to change notification settings - Fork 293
Open
Labels
Description
Describe the bug
Trying to save a model containing TransformerEncoder
layer results in an error. This is due to some weights of it having the same exact name, and h5 format is raising a ValueError
because of that.
To Reproduce
from keras_nlp.layers import TransformerEncoder
inp = keras.layers.Input((30, 128))
tl = TransformerEncoder(
intermediate_dim=512,
num_heads=8,
)
model = keras.models.Model(inp, tl(inp))
model.save_weights('test.h5')