指标¶
对于指标,我们建议使用Tensorboard直接将指标记录到云存储中,并与您的模型一起。在模型训练过程中,您可以使用本地启动一个tensorboard实例来监控您的模型进度:
$ tensorboard --log-dir provider://path/to/logs
或者你可以使用torchx.components.metrics.tensorboard()组件作为
你的管道的一部分。
请参阅Trainer App 示例,了解如何使用 PyTorch Lightning TensorboardLogger。
参考¶
PyTorch TensorBoard 教程 https://pytorch.org/tutorials/intermediate/tensorboard_tutorial.html
PyTorch Lightning 日志记录器 https://pytorch-lightning.readthedocs.io/en/stable/extensions/logging.html
- torchx.components.metrics.tensorboard(logdir: str, image: str = 'ghcr.io/pytorch/torchx:0.1.1', timeout: float = 3600, port: int = 6006, start_on_file: str = '', exit_on_file: str = '') → torchx.specs.api.AppDef[source]¶
此组件运行一个 Tensorboard 服务器,该服务器将渲染由 logdir 指定的日志。
由于Tensorboard作为服务运行,您需要指定终止条件。这包括一个超时时间以及一个可选的
exit_on_file,当该路径被创建时,会导致服务退出。这些文件会通过 fsspec 定期检查是否存在,并在创建时触发相应的行为。
- Parameters
logdir – fsspec路径到Tensorboard日志
图像 – 使用的图像
超时 – 最大运行时间(秒)
创建fsspec路径时启动服务器 – start the server when the fsspec path is created
exit_on_file – 创建 fsspec 路径时关闭服务器