Used Pretraing Model In Tensorflow .ckpt File
I have a ckpt file . I just want to get the weights of the cnn that I have trained from a ckpt checkpoint file.? inception_resnet_v2_2016_08_30 import tensorflow as tf saver = tf
Solution 1:
The tf.train.Saver.restore()
method only works if you have already built the graph structure (including a set of tf.Variable
objects) into which the checkpoint will be restored. You have (at least) two options for solving this problem:
Use
tf.train.NewCheckpointReader("inception_resnet_v2_2016_08_30.ckpt")
to open the checkpoint file. You can call theget_tensor()
method on the returned object to look up a saved variable by name, or theget_variable_to_shape_map()
method to get a list of the available variables.If you have one, load a MetaGraph for the checkpointed mode, which includes the graph structure and a mapping from that graph structure to the variables in the checkpoint.
Post a Comment for "Used Pretraing Model In Tensorflow .ckpt File"