Hello! I'm running into similar problems, trying to train a BERT text classifier in tensor flow. I'm using tf and tf-text 2.9.0, and tf-metal 0.5.0
My model looks as follows:
text_input = tf.keras.layers.Input(shape=(), dtype=tf.string, name = "text")
encoder_inputs = bert_preprocess(text_input)
outputs = bert_encoder(encoder_inputs)
bert_embeds = outputs["pooled_output"]
intermediate_layer = tf.keras.layers.Dense(512, activation = "relu", name = "intermediate_layer")(bert_embeds)
dropout_layer = tf.keras.layers.Dropout(0.1, name = "dropout_layer")(intermediate_layer) # neurons are dropped at rate 0.1 to prevent overfitting
output_layer = tf.keras.layers.Dense(1, activation = "sigmoid", name = "output_layer")(dropout_layer)
model = tf.keras.Model(text_input, output_layer)
I'm getting the error when fitting the model. Do I interpret the error code correctly (which is the same as the error code shared by the OP), that only int 64 is supported currently by the AddN Op Kernel? However, this would conflict with the bert_embeds pooled_output which is in floats (I tried forcing to 64 float, but that didn't solve the issue). My outcome variable is binary, I forced it to int64.
Any help would be appreciated. My model works when I run it on CPU, but is just quite slow.
Thanks and best
Amin
Topic:
App & System Services
SubTopic:
Core OS
Tags: