Skip to content

Instantly share code, notes, and snippets.

@securetorobert
Created September 28, 2019 17:17
Show Gist options
  • Save securetorobert/f6e2ed95423accf9804a8f3f06fa986a to your computer and use it in GitHub Desktop.
Save securetorobert/f6e2ed95423accf9804a8f3f06fa986a to your computer and use it in GitHub Desktop.
Add layers for transfer learning in TF 2.0
x = base_model.output
x = layers.GlobalAveragePooling2D()(x)
x = layers.Dense(4096, activation='relu')(x)
x = layers.Dense(1, activation='sigmoid')(x)
model_3 = models.Model(inputs=base_model.input, outputs=x)
print(model_3.summary())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment