0
私はTensorflowを理解しようとしています。私は公式の例であるCifar-10モデルの1つを見ています。推論でcifar10.pyでTensorflow:Cifar-10モデルの出力ノード名は何ですか?
、()は、次の行を見ることができます:
with tf.variable_scope('softmax_linear') as scope:
weights = _variable_with_weight_decay('weights', [192, NUM_CLASSES],
stddev=1/192.0, wd=0.0)
biases = _variable_on_cpu('biases', [NUM_CLASSES],
tf.constant_initializer(0.0))
softmax_linear = tf.add(tf.matmul(local4, weights), biases, name=scope.name)
_activation_summary(softmax_linear)
scope.nameはsoftmax_linearであるべきであり、それは、ノードの名前でなければなりません。私は、次の行(それはチュートリアルとは異なり)でグラフプロトを保存:
with tf.Graph().as_default():
global_step = tf.Variable(0, trainable=False)
# Get images and labels
images, labels = cifar10.distorted_inputs()
# Build a Graph that computes the logits predictions from the
# inference model.
logits = cifar10.inference(images)
# Calculate loss.
loss = cifar10.loss(logits, labels)
# Build a Graph that trains the model with one batch of examples and
# updates the model parameters.
train_op = cifar10.train(loss, global_step)
# Create a saver.
saver = tf.train.Saver(tf.global_variables())
# Build the summary operation based on the TF collection of Summaries.
summary_op = tf.summary.merge_all()
# Build an initialization operation to run below.
init = tf.global_variables_initializer()
# Start running operations on the Graph.
sess = tf.Session(config=tf.ConfigProto(
log_device_placement=FLAGS.log_device_placement))
sess.run(init)
# save the graph
tf.train.write_graph(sess.graph_def, FLAGS.train_dir, 'model.pbtxt')
....
しかし、私はmodel.pbtxtにsoftmax_linearと呼ばれるノードを参照することはできません。私は間違って何をしていますか?出力ノードの名前でグラフをエクスポートしたいだけです。
ありがとうございました!あなたが正しい。 softmax_linear/softmax_linearは存在しません。 – Kuranes