​.name​​即可

for variable in tf.trainable_variables():
print(variable.name)