Answers for "How can I get the output of each layer in Tensorflow 2"

0

How can I get the output of each layer in Tensorflow 2

from tensorflow.python.keras import backend as K

model = build_model() 
# lstm_67 is the second layer.
lstm = K.function([model.layers[0].input], [model.layers[1].output])
lstm_output = lstm([test_x])[0]
Posted by: Guest on February-25-2022

Code answers related to "How can I get the output of each layer in Tensorflow 2"

Browse Popular Code Answers by Language