ValueError: Only instances of keras.Layer
can be added to a Sequential model. Received: <tensorflow_hub.keras_layer.KerasLayer object at 0x7a9a39daf130> (of type <class 'tensorflow_hub.keras_layer.KerasLayer'>)
#662
moatednorth
started this conversation in
General
Replies: 2 comments 1 reply
-
Same issue, please do let me know if you find some solution around this issue |
Beta Was this translation helpful? Give feedback.
1 reply
-
use tf-keras |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sequential api can't handle
hub.KerasLayer
`
Create a Keras Layer using the USE pretrained layer from Kaggle
sentence_encoder_layer = hub.KerasLayer("https://www.kaggle.com/models/google/universal-sentence-encoder/TensorFlow2/universal-sentence-encoder/2",
input_shape=[],
dtype=tf.string,
trainable=False,
name="USE")
Create model using the Sequential API
model_6 = tf.keras.Sequential([
sentence_encoder_layer,
layers.Dense(64, activation="relu"),
layers.Dense(1, activation="sigmoid", name="ouput_layer")
], name="model_6_USE")
`
Beta Was this translation helpful? Give feedback.
All reactions