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

Resolve Libraries Conflict in chapter3/section3_tf.ipynb #495

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

heispv
Copy link

@heispv heispv commented May 25, 2024

As documented in Issue #19262 on the Keras GitHub repository, there was a conflict between the Transformers and Keras libraries. Specifically, executing the following code resulted in an error associated with the Adam optimizer:

import tensorflow as tf

model = TFAutoModelForSequenceClassification.from_pretrained('checkpoint', num_labels=2)
loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
model.compile(optimizer='opt', loss=loss, metrics=["accuracy"])

I have updated the notebook to resolve this issue. With the modifications applied, the error no longer occurs, ensuring compatibility between the two libraries.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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

Successfully merging this pull request may close these issues.

1 participant