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

Fix Text classification with TensorFlow Hub #2323

Closed
wants to merge 1 commit into from

Conversation

dnoliver
Copy link

@dnoliver dnoliver commented Sep 4, 2024

  • install tf_keras
  • use tf_keras model and layers

Run into a problem while running the cell:

Only instances of keras.Layer can be added to a Sequential model. Received: <tensorflow_hub.keras_layer.KerasLayer

Applied the fix described in tensorflow/tensorflow#63849.
After the change, the notebook works end to end.
But I think this actually downgrades the tf_keras support from 3 to 2, as noted in tensorflow/tensorflow#63849 (comment).

If the notebook is supposed to work as is, without this fix applied, then this PR shows how to apply the workaround to the notebook until the main issue is figured out :)

* install tf_keras
* use tf_keras model and layers
@dnoliver dnoliver requested a review from a team as a code owner September 4, 2024 21:51
Copy link

google-cla bot commented Sep 4, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

github-actions bot commented Sep 4, 2024

Preview

Preview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com.

Format and style

Use the TensorFlow docs notebook tools to format for consistent source diffs and lint for style:
$ python3 -m pip install -U --user git+https://github.com/tensorflow/docs

$ python3 -m tensorflow_docs.tools.nbfmt notebook.ipynb
$ python3 -m tensorflow_docs.tools.nblint --arg=repo:tensorflow/docs notebook.ipynb
If commits are added to the pull request, synchronize your local branch: git pull origin tf-hub-fix

@8bitmp3 8bitmp3 added cla: no CLA has not been signed awaiting-contributor-response Indicates a question, draft, or work-in-progress labels Oct 3, 2024
@8bitmp3
Copy link
Contributor

8bitmp3 commented Oct 3, 2024

Thank you @dnoliver . Please review the CLA .

@MarkDaoust @markmcd keras. instead of tf_keras. or both in layer names?

Copy link

Marking this pull request as stale since it has been open for 14 days with no activity. This PR will be closed if no further activity occurs.

Copy link

github-actions bot commented Nov 1, 2024

This pull request was closed because it has been inactive for 28 days. Please open a new pull request if you need further assistance. Thanks!

@github-actions github-actions bot closed this Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-contributor-response Indicates a question, draft, or work-in-progress cla: no CLA has not been signed status:stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants