raise ValueError(
"Need to provide a destination directory for the SavedModel.")
model = lib_graph.load_checkpoint(FLAGS.checkpoint)
export_saved_model(model, FLAGS.destination)
tf.logging.info("Exported SavedModel to %s.", FLAGS.destination)
if __name__ == "__main__":
After Change
model.instantiate_sess_and_restore_checkpoint()
else:
model = lib_graph.load_checkpoint(FLAGS.checkpoint)
tf.logging.info("Loaded graph.")
lib_saved_model.export_saved_model(model, FLAGS.destination,
[tf.saved_model.tag_constants.SERVING],
FLAGS.use_tf_sampling)
tf.logging.info("Exported SavedModel to %s.", FLAGS.destination)