TensorFlow Model - 3.0 English

Vitis AI Optimizer User Guide (UG1333)

Document ID
UG1333
Release Date
2023-01-12
Version
3.0 English

TensorFlow saves variables in binary checkpoint files that map variable names to tensor values. vai_p_tensorflow takes a checkpoint file as input to load trained weights. tf.train.Saver provides methods to specify paths for the checkpoint files.

The following code snippet calls the tf.train.Saver.save method to save variables to checkpoint files:

with tf.Session() as sess:
# assemble the graph here
# ……
sess.run(train_op)

# Save the variables to disk.
save_path = saver.save(sess, "/tmp/model.ckpt")
print("Model saved in path: %s" % save_path)

The saved checkpoint files look like this:

model.ckpt.data-00000-of-00001
model.ckpt.index
model.ckpt.meta