def load_old_model(sess, nlayers, device='/cpu:0'):
with tf.device(device):
new_saver = tf.train.import_meta_graph(meta_fn(nlayers))
new_saver.restore(sess, checkpoint_fn(nlayers))
graph = tf.get_default_graph()
prob_tensor = graph.get_tensor_by_name("prob:0")
images = graph.get_tensor_by_name("images:0")
return graph, images, prob_tensor
评论列表
文章目录