Created
July 11, 2019 22:02
-
-
Save zmjjmz/fcc73dad9f49d34f9c047c108fdd0e3f to your computer and use it in GitHub Desktop.
TF keras export usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
# Create a tf.keras model. | |
print(tf.version.VERSION) | |
model = tf.keras.Sequential() | |
model.add(tf.keras.layers.Dense(1, input_shape=[10])) | |
model.summary() | |
# Save the tf.keras model in the SavedModel format. | |
saved_to_path = tf.keras.experimental.export( | |
model, 'my_simple_tf_keras_saved_model') | |
# Load the saved keras model back. | |
model_prime = tf.keras.experimental.load_from_saved_model(saved_to_path) | |
model_prime.summary() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, and here's the output!