salesforce / ctrl

Conditional Transformer Language Model for Controllable Generation

Home Page:https://arxiv.org/abs/1909.05858

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'tensorflow._api.v1.keras.layers' has no attribute 'LayerNormalization'

manueltonneau opened this issue · comments

Thanks for the great contribution.
I'm following the instructions to fine-tune CTRL on the Moby-Dick dataset and faced this error. Any idea why this could happen? Thanks a lot in advance!

More details on the error here:
Traceback (most recent call last):
File "training.py", line 116, in
transformed = transformer.Encoder()(embedded, training=False)
File "../transformer.py", line 116, in init
setattr(self, "layer%i" % i, EncoderLayer(d_model_size, num_heads, dff, rate))
File "../transformer.py", line 83, in init
self.layernorm1 = tf.keras.layers.LayerNormalization(epsilon=1e-6)
AttributeError: module 'tensorflow._api.v1.keras.layers' has no attribute 'LayerNormalization'

Can you verify that you're using pip install tensorflow[-gpu]==1.14 ?

This solved the problem, thanks!