【问题标题】:print and get training parameters (weights)打印并获取训练参数(权重)
【发布时间】:2017-03-12 07:32:33
【问题描述】:

我需要打印训练步骤中使用的所有权重和偏差,我们可以在下面的代码中看到https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/udacity/6_lstm.ipynb。我们有变量 v 包含所有参数,我尝试打印它但结果是 NONE,我尝试使用 saver() 和 resrore 但我无法读取检查点文件

所以有什么解决办法 谢谢


【问题讨论】:

标签: python tensorflow


【解决方案1】:
all_vars = tf.global_variables()
# just want to make sure all our variables are there!
for v in all_vars:
    v_ = sess.run(v)
    print("This is {} with value: {}".format(v.name, v_))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-07
    • 2019-05-28
    • 2020-04-16
    • 2020-01-12
    • 1970-01-01
    相关资源
    最近更新 更多