Get list of Keras variables
To get the variable's name you need to access it from the weight attribute of the model's layer. Something like this:
names = [weight.name for layer in model.layers for weight in layer.weights]
And to get the shape of the weight:
weights = [weight.shape for weight in model.get_weights()]
I'd like to compare variables in a Keras model with those from a TensorFlow checkpoint. I can get the TF variables like this:
vars_in_checkpoint = tf.train.list_variables(os.path.join("./model.ckpt"))
How can I get the Keras variables to compare from my model?