You also need to initialise the local variables hidden in the tf.metrics.recallmethod.
For example, this piece of code would work:
init_g = tf.global_variables_initializer()
init_l = tf.local_variables_initializer()
with tf.Session() as sess:
sess.run(init_g)
sess.run(init_l)
本文介绍如何正确初始化TensorFlow中的全局变量及本地变量,特别是当使用tf.metrics.recall等方法时,需要分别初始化全局变量和本地变量。通过示例代码展示了初始化过程。

被折叠的 条评论
为什么被折叠?



