0
訓練有素我的網絡並保存最終的權重這樣的總結:我如何總結張恢復到一個變量
# ...
weights_summaries.append(tf.summary.tensor_summary('out-weights', weights['out']))
# ... write summary
現在我想用我的分類。我試圖從總結加載重量:
for e in tf.train.summary_iterator(summary_file):
for v in e.summary.value:
# ...
# found the node
elif v.node_name == 'out-weights':
weights['out'] = tf.Variable(v.tensor)
# it doesn't work!
weights['out'] = tf.Variable.from_proto(v)
# assert!
weights['out'] = tf.Variable.from_proto(v.tensor)
# assert!
weights['out'] = tf.Variable(tf.Tensor.from_proto(v.tensor))
# Tensor.from_proto is not defined!
那麼,我應該如何加載權重?我瞭解「全局」模型保存程序,但我更願意只保存我需要的數據。
由於提前, 亞歷山大
謝謝你的建議。如果能夠從摘要中恢復權重,那將是非常好的, –