Skip to content

Instantly share code, notes, and snippets.

@theSLWayne
Created March 20, 2021 15:07
Show Gist options
  • Save theSLWayne/6e0cf0bcfbf42b523385222d31371ffa to your computer and use it in GitHub Desktop.
Save theSLWayne/6e0cf0bcfbf42b523385222d31371ffa to your computer and use it in GitHub Desktop.
import tensorflow as tf
# Create the model
model = tf.keras.models.Sequential([
tf.keras.layers.Conv2D(16, kernel_size = (3, 3), activation = 'relu', padding = 'same', input_shape = (244, 244, 3)),
tf.keras.layers.MaxPool2D(pool_size = (2, 2), strides = 2),
tf.keras.layers.Conv2D(32, kernel_size = (3, 3), activation = 'relu', padding = 'same'),
tf.keras.layers.MaxPool2D(pool_size = (2, 2), strides = 2),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(2, activation = 'softmax')
])
# Save the model
model.save("keras_model.h5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment