如何更改张量板的日志记录级别?

时间:2019-07-01 01:55:46

标签: logging tensorboard

我在tensorboard的启动参数中找不到这样的选项。当我列出所有标志时,我发现的是这样的:

logdir      --> .tensorboard/log_2019-06-30_18-33-18_952122
host      --> 
port      --> None
purge_orphaned_data      --> True
reload_interval      --> 5.0
db      --> 
db_import      --> False
db_import_use_op      --> False
inspect      --> False
version_tb      --> False
tag      --> 
event_file      --> 
path_prefix      --> 
window_title      --> 
max_reload_threads      --> 1
reload_task      --> auto
samples_per_plugin      --> 
debugger_data_server_grpc_port      --> -1
debugger_port      --> -1
master_tpu_unsecure_channel      --> 

在操作中,它的日志记录级别设置为“警告”,并且日志消息直接打印在stdout上,结果,在编写复杂模型时,我看到很多不必要的消息,例如:

I0630 18:33:19.152284 140581946894080 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:19] "GET / HTTP/1.1" 200 -
I0630 18:33:19.335198 140581946894080 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:19] "GET /font-roboto/oMMgfZMQthOryQo9n22dcuvvDin1pK8aKteLpeZ5c0A.woff2 HTTP/1.1" 200 -
I0630 18:33:20.419392 140581806262016 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/plugins_listing HTTP/1.1" 200 -
I0630 18:33:20.422904 140581212772096 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/environment HTTP/1.1" 200 -
I0630 18:33:20.424074 140581221164800 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/runs HTTP/1.1" 200 -
I0630 18:33:20.428111 140581204379392 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/experiments HTTP/1.1" 200 -
I0630 18:33:20.490971 140581204379392 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /font-roboto/RxZJdnzeo3R5zSexge8UUZBw1xU1rKptJj_0jans920.woff2 HTTP/1.1" 200 -
I0630 18:33:20.519970 140581204379392 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/plugins_listing HTTP/1.1" 200 -
I0630 18:33:20.522117 140581221164800 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/environment HTTP/1.1" 200 -
I0630 18:33:20.531321 140581212772096 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/runs HTTP/1.1" 200 -
I0630 18:33:20.533931 140581221164800 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /data/experiments HTTP/1.1" 200 -
I0630 18:33:20.709606 140581221164800 _internal.py:122] ::ffff:127.0.0.1 - - [30/Jun/2019 18:33:20] "GET /font-roboto/d-6IYplOFocCacKzxwXSOJBw1xU1rKptJj_0jans920.woff2 HTTP/1.1" 200 -

我如何摆脱它们?

1 个答案:

答案 0 :(得分:1)

我要做的唯一一件事就是关闭整个程序的日志记录。我希望有一个更优雅的解决方案,但现在它可以避免烦人的刷新通知:

logging.disable(logging.ERROR)

希望这会有所帮助!

(Tensorboard小组,请添加详细程度标记或类似内容)