【发布时间】:2017-01-25 16:30:37
【问题描述】:
我正在使用 tensorflow-deeplab-resnet model,它使用 caffe-tensorflow 将 Caffe 中实现的 Resnet 模型传输到 tensorflow。
我想知道如何访问从 Caffe 导入的模型中的各个变量,以便检查出了什么问题。
我试过了
allTrainVars = tf.trainable_variables()
for f in allTrainVars:
print f.name
哪个输出
[...]
res5c_branch2c/weights:0
bn5c_branch2c/scale:0
bn5c_branch2c/offset:0
bn5c_branch2c/mean:0
bn5c_branch2c/variance:0
fc1_voc12_c0/weights:0
fc1_voc12_c0/biases:0
fc1_voc12_c1/weights:0
fc1_voc12_c1/biases:0
fc1_voc12_c2/weights:0
fc1_voc12_c2/biases:0
fc1_voc12_c3/weights:0
fc1_voc12_c3/biases:
fc1_voc12_c* 层是需要随机重新初始化的有趣层。但是当我尝试访问它们并像这样向变量添加日志记录时
var = [v for v in tf.trainable_variables() if v.name == "fc1_voc12_c0/weights:0"][0]
tf.summary.histogram("fc1_voc12_c0/weights_0", var)
我在 tensorboard 中看不到那个变量。 tensorboard 中唯一显示的是图形本身。
如何访问这些变量以便在 tensorboard 中监控它们?
我可以通过查看图表来推断出我想要监控的变量的正确名称吗(见图)?
编辑
我稍微编辑了我的问题的焦点,因为代码作者现在已经修复了一个错误。
【问题讨论】: