如何用Keras消除tensorflow的冗长消息

2024-05-09 01:29:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在试用tensorflow Keras后端。它不断地将这些过于冗长的消息打印到终端,这会破坏probar记录器的输出。例如如下。在

h 1/200
   4608/3629568 [..............................] - ETA: 849s - loss: 1.1816I tensorflow/core/common_runtime/gpu/pool_allocator.cc:244] PoolAllocator: After 4208 get requests, put_count=4193 evicted_count=1000 eviction_rate=0.238493 and unsatisfied allocation rate=0.264971
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:256] Raising pool_size_limit_ from 100 to 110

我怎样才能使张量流相当呢?我已经看过文档了,找不到任何类似于.theanorc文件的设置。在


Tags: core终端消息gpuratetensorflowcountcommon
1条回答
网友
1楼 · 发布于 2024-05-09 01:29:30

如果使用的是TensorFlow 0.12,可以设置TF_CPP_MIN_LOG_LEVEL环境变量来过滤日志消息。例如,您可以用这种方式启动python,以避免INFO级别的消息(例如,您的任务中的“提升池大小限制”消息):

$ TF_CPP_MIN_LOG_LEVEL=1 python ...

相关问题 更多 >