October 2018
Intermediate to advanced
472 pages
10h 57m
English
Now, we will create an inference code that loads the latest checkpoints and then makes predictions on the basis of learned parameters. For that, we need to create a saver operation that will pick the latest checkpoints and load the metadata. Metadata contains the information regarding the variables and the nodes that we created in the graph:
# Pointing the model checkpointcheckpoint_file = tf.train.latest_checkpoint(os.path.join(hy_param.checkpoint_dir, 'checkpoints'))saver = tf.train.import_meta_graph("{}.meta".format(checkpoint_file))
We know the importance of this, because we want to load similar variables and operations back from the stored checkpoint. We load them into memory using tf.get_default_graph().get_operation_by_name() ...
Read now
Unlock full access