Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error with newest version of tensorflow, keras, and transformer for BERTurk #53

Open
dwicak opened this issue Mar 21, 2024 · 0 comments

Comments

@dwicak
Copy link

dwicak commented Mar 21, 2024

After updating tensorflow, keras and trasformer then ran this code:

# Konfigurasi optimizer, loss, dan metrik
optimizer = tf.keras.optimizers.Adam(learning_rate=2e-5)
loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
metric = tf.keras.metrics.SparseCategoricalAccuracy('accuracy')

# Kompilasi model
model.compile(optimizer=optimizer, loss=loss, metrics=[metric])

# Pelatihan model
model.fit(train_dataset, epochs=3, validation_data=test_dataset)

I got an error like this:

RuntimeError: Failed to import transformers.models.bert.modeling_tf_bert because of the following error (look up to see its traceback):
module 'tensorflow._api.v2.compat.v2.internal' has no attribute 'register_load_context_function'

What happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant