0

I have a Tensorflow v1 session graph (trained) and want to retrieve the weights and biases from it to input them into a Keras model with the same architecture. I have managed to get all the weights with the following calls, but not the biases. I tried:

tf.all_variables()
tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES)
tf.get_collection(tf.GraphKeys.BIASES) 

Any ideas on how to get the biases as well?

Alberto
  • 396
  • 4
  • 11

1 Answers1

0

Solution: the model was initially trained with convolutional layers with only trainable weights and not the biases as well. To recover the model properly with Keras, set the biases to be 0.

Alberto
  • 396
  • 4
  • 11