I have trained a ConvNet model with TensorFlow, and I want to get a particular weight in layer. For example in torch7 I would simply access model.modules[2].weights
So if you proceed this code step by step, you will first get a list of used/trainable variables. Then you could sort them in a list where you sort weight matrices/lists to variable names, just for example how you were possible to deal with that information.
vars = tf.trainable_variables()
print(vars) #some infos about variables...
vars_vals = sess.run(vars)
for var, val in zip(vars, vars_vals):
print("var: {}, value: {}".format(var.name, val)) #...or sort it in a list....