【问题标题】:How to get rid of tensorflow verbose messages with Keras如何使用 Keras 摆脱 tensorflow 冗长消息
【发布时间】:2023-03-24 06:20:01
【问题描述】:

我正在试用 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 文件的设置。

【问题讨论】:

标签: python tensorflow keras


【解决方案1】:

如果您使用的是 TensorFlow 0.12,您可以设置 TF_CPP_MIN_LOG_LEVEL 环境变量来过滤掉日志消息。例如,您可以通过这种方式启动python,以避免出现INFO 级别的消息(例如您的任务中的“Raising pool_size_limit_”消息):

$ TF_CPP_MIN_LOG_LEVEL=1 python ...

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-29
  • 1970-01-01
  • 1970-01-01
  • 2019-05-07
  • 2019-02-03
  • 2019-07-14
相关资源
最近更新 更多