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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions site/en/tutorials/keras/text_classification_with_hub.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"outputs": [],
"source": [
"!pip install tensorflow-hub\n",
"!pip install tensorflow-datasets"
"!pip install tensorflow-datasets\n",
"!pip install tf_keras"
]
},
{
Expand All @@ -138,6 +139,7 @@
"import tensorflow as tf\n",
"import tensorflow_hub as hub\n",
"import tensorflow_datasets as tfds\n",
"import tf_keras\n",
"\n",
"print(\"Version: \", tf.__version__)\n",
"print(\"Eager mode: \", tf.executing_eagerly())\n",
Expand Down Expand Up @@ -290,10 +292,10 @@
},
"outputs": [],
"source": [
"model = tf.keras.Sequential()\n",
"model = tf_keras.Sequential()\n",
"model.add(hub_layer)\n",
"model.add(tf.keras.layers.Dense(16, activation='relu'))\n",
"model.add(tf.keras.layers.Dense(1))\n",
"model.add(tf_keras.layers.Dense(16, activation='relu'))\n",
"model.add(tf_keras.layers.Dense(1))\n",
"\n",
"model.summary()"
]
Expand Down