Created
November 8, 2019 16:19
-
-
Save LysandreJik/e85ee423a54fcc2d2d0664f04490eb0e to your computer and use it in GitHub Desktop.
Save a HUB model to a checkpoint
This file contains hidden or 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 | |
import tensorflow_hub as hub | |
model_size = 'xlarge'.upper() | |
version = 2 | |
model = hub.Module("https://tfhub.dev/google/albert_{}/{}".format(model_size.lower(), version), trainable=False) | |
init = tf.global_variables_initializer() | |
saver = tf.train.Saver() | |
with tf.Session() as sess: | |
sess.run(init) | |
path = "path_to_albert/albert" | |
save_path = saver.save(sess, path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment