我目前正在Tensorflow中查看Eager模式,想知道是否可以提取要在Tensorboard中使用的图形。我了解Tensorflow Eager模式实际上并没有用户必须创建的图形或会话系统。但是,据我了解,有一个隐藏的东西。是否可以导出此隐藏的Graph和Session以在Tensorboard中支持可视图形视图?还是我需要将模型重做为执行的Graph / Session形式?
我想使用 Tensorflow 和 Tensorboard V2 将精度和召回率合并到同一个图上。我找到了许多以前版本的示例,但没有一个适用于我的情况。
我创建了一个 Keras 回调来计算精度和召回率,然后调用张量流摘要将它们记录在同一个记录器中。我可以在 Tensorboard 中将它们可视化,但在 2 个独立的图中。
Class ClassificationReport(Callback):
def __init__(self, data_generator, steps, label_names, log_directory):
"""
Instantiator
:param data_generator: the data generator that produces the input data
:param steps: int, batch size
:param data_type, string, 'training', 'validation' or 'test', used a prefix in the logs
:param log_directory: pathlib2 path to the TensorBoard log directory
"""
self.data_generator = data_generator
self.steps = steps
self.data_type = data_type
self.logger = tensorflow.summary.create_file_writer(str(log_directory / self.data_type))
# names of the scalar …Run Code Online (Sandbox Code Playgroud)