我正在尝试将tf.summary.tensor_summary运算符添加到我正在使用的模块中,但是摘要从未出现在TB中,因此在它旁边添加标量摘要似乎可行。 在train.py中,我有(某些行已被注释掉以保持相关性)
tf.summary.scalar('bn_decay', bn_decay)
# Get model and loss
pred, end_points, summary_d = MODEL.get_model()
tf.summary.scalar('loss', loss)
tf.summary.scalar('accuracy', accuracy)
train_op = optimizer.minimize(loss, global_step=batch)
saver = tf.train.Saver()
merged = tf.summary.merge_all()
train_writer = tf.summary.FileWriter(os.path.join(LOG_DIR, 'train/' + str(FLEX_KER)),
sess.graph, filename_suffix=str(time.strftime("%H-%M-%d-%m")))
for step in range(num_steps):
train_step(sess, train_op, total_loss, global_step)
if step % n_steps == 0:
summary = sess.run(merged)
train_writer.add_summary(summary, step)
现在-MODEL.get_model从另一个文件调用函数transform_net
,依次调用tf_util.conv2d
,这是我围绕conv2d
构建的包装器
在tf_util.conv2d
内部,我尝试:
tf.summary.tensor_summary('weight_param', weight_param) //some tensor inside conv2d
tf.summary.scalar('test',123)