【发布时间】:2019-03-30 15:30:59
【问题描述】:
我想简单地定义一个模型并在 TensorBoard 中可视化它的图形以进行初步的架构检查。因此,我不想为此计算任何东西。
在 TensorFlow 1.X 中,很容易在 tf.Session() 中实现,我可以简单地 flush() 一个摘要文件编写器。
在 TensorFlow 2.0 中,没有 tf.Session(),因此问题是如何实现它?
以下是示例代码。为了在 TensorBoard 中编写图形结构,我需要添加哪些内容?
from nets import i3d
import tensorflow as tf
def i3d_output(model, x):
out, _ = model(x)
return out
tf.compat.v1.disable_eager_execution()
x = tf.random.uniform(shape=(4,179,224,224,3))
model = i3d.InceptionI3d()
net = i3d_output(model, x)
train_summary_writer = tf.summary.create_file_writer('/home/uujjwal/bmvc2019')
【问题讨论】: