'How to print the value which type of the kerasTensor

This is part of the network structure:

inputs = Input(shape=(time_step, dim))
lstm_out = LSTM(5, return_sequen`enter code here`ces=True)(inputs)
print(lstm_out)
attention_mul = attention_3d_block(inputs)
attention_flatten = Flatten()(attention_mul)
output = Dense(1, activation='linear')(attention_flatten)
model = Model(inputs=inputs, outputs=output)
Adam = optimizers.Adam(lr=0.001)

I want to try to print the result value of the LSTM layer : "print(lstm_out)"

but it give me the ...: KerasTensor(type_spec=TensorSpec(shape=(None, 3, 5), dtype=tf.float32, name=None), name='lstm/PartitionedCall:1', description="created by layer 'lstm'")

I just want to get the "value"

please give me some advice



Solution 1:[1]

Have you tried to use tf.print

(Sorry I don't have enough reputation to comment)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Loris Pilotto