Skip to content

Instantly share code, notes, and snippets.

@jamescalam
Created April 1, 2020 16:44
Show Gist options
  • Save jamescalam/96d96ab2a28fde6e562a6296df150ac9 to your computer and use it in GitHub Desktop.
Save jamescalam/96d96ab2a28fde6e562a6296df150ac9 to your computer and use it in GitHub Desktop.
Snippet showing how to load a model from saved weights. We load with batch size of 1 ready for text generation.
model = build_model(len(vocab), EMBED_DIM, UNITS, 1)
model.load_weights(tf.train.latest_checkpoint('./training_checkpoints')
model.build(tf.TensorShape([1, None]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment