Skip to content

Different between Feature vector and classification model on TF-Hub #163

Answered by teddcp2
teddcp2 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok. I found the answer Which is dumb actually. There 2 ways we can use extrernal models. One through the TF-Hub and another is keras.applications. We need to set the include_top=False on Keras application layer, not in models based on tf-hub.

Differences in how to use it with Tf-hub and Keras

# Feature vector based model
m = tf.keras.Sequential([
    hub.KerasLayer("https://tfhub.dev/tensorflow/efficientnet/b0/feature-vector/1",
                   trainable=False),  # Can be True, see below.
    tf.keras.layers.Dense(num_classes, activation='softmax')
])

# Classification based model
m = tf.keras.Sequential([
    hub.KerasLayer("https://tfhub.dev/tensorflow/efficientnet/b0/classificatio…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mrdbourke
Comment options

@teddcp2
Comment options

@mrdbourke
Comment options

@teddcp2
Comment options

Answer selected by teddcp2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants