spi*_*tor 7 python logging pytorch-lightning
PyTorch-Lightning 中的记录器打印有关要训练(或评估)的模型以及训练过程中的进度的信息,
但是,就我而言,我想隐藏记录器中的所有消息,以免淹没Jupyter Notebook.
我在官方文档页面上查看了 Trainer 类的 API https://pytorch-lightning.readthedocs.io/en/latest/common/trainer.html#trainer-flags,似乎没有选择关闭来自记录器的消息。
有一个参数log_every_n_steps可以设置为很大的值,但尽管如此,每个时期后的记录结果都会显示。
如何禁用日志记录?
我假设在泛洪输出流方面有两件事特别困扰您:
\n一、“体重总结”:
\n | Name | Type | Params\n--------------------------------\n0 | l1 | Linear | 100 K \n1 | l2 | Linear | 1.3 K \n--------------------------------\n...\nRun Code Online (Sandbox Code Playgroud)\n二、进度条:
\nEpoch 0: 74%|\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88 | 642/1874 [00:02<00:05, 233.59it/s, loss=0.85, v_num=wxln]\nRun Code Online (Sandbox Code Playgroud)\nPyTorch Lightning 提供了非常清晰和优雅的解决方案来关闭它们:Trainer(progress_bar_refresh_rate=0)关闭进度条和Trainer(weights_summary=None)关闭体重摘要。