import tensorflow as tf
from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file
latest_ckp = tf.train.latest_checkpoint('./')
print_tensors_in_checkpoint_file(latest_ckp, all_tensors=True, tensor_name='')
import tensorflow as tf
from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file
checkpoint_path = "./model.ckpt-0"
print_tensors_in_checkpoint_file(checkpoint_path, all_tensors=False, tensor_name='InceptionResnetV2/Conv2d_7b_1x1/BatchNorm/beta')
# 打印变量名
for var_name, _ in tf.contrib.framework.list_variables(
checkpoint_path):
print(var_name)