首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >tensorflow的nosetest:大量调试输出,如何禁用

tensorflow的nosetest:大量调试输出,如何禁用
EN

Stack Overflow用户
提问于 2017-04-11 05:43:10
回答 2查看 3.5K关注 0票数 9

当我将nosetests与一些带有TensorFlow的测试脚本一起使用时,我从TensorFlow获得了大量调试输出:

代码语言:javascript
复制
az@azmacbookpro ~/P/crnn> nosetests tests/test_TFUtil.py 
Level 1:tensorflow:Registering FakeQuantWithMinMaxArgs (<function _FakeQuantWithMinMaxArgsGradient at 0x112306048>) in gradient.
Level 1:tensorflow:Registering FakeQuantWithMinMaxVars (<function _FakeQuantWithMinMaxVarsGradient at 0x1126ba9d8>) in gradient.
Level 1:tensorflow:Registering FakeQuantWithMinMaxVarsPerChannel (<function _FakeQuantWithMinMaxVarsPerChannelGradient at 0x1126ba950>) in gradient.
...
Level 1:tensorflow:Registering Fact (<function _set_call_cpp_shape_fn.<locals>.call_without_requiring at 0x1122c0268>) in default shape functions.
Level 1:tensorflow:Registering TensorSummary (None) in gradient.
Level 1:tensorflow:Registering queue_runners ((<class 'tensorflow.core.protobuf.queue_runner_pb2.QueueRunnerDef'>, <function QueueRunner.to_proto at 0x1130687b8>, <function QueueRunner.from_proto at 0x113068840>)) in proto functions.
E
======================================================================
...
-------------------- >> begin captured logging << --------------------
tensorflow: Level 1: Registering FakeQuantWithMinMaxArgs (<function _FakeQuantWithMinMaxArgsGradient at 0x112306048>) in gradient.
tensorflow: Level 1: Registering FakeQuantWithMinMaxVars (<function _FakeQuantWithMinMaxVarsGradient at 0x1126ba9d8>) in gradient.
tensorflow: Level 1: Registering FakeQuantWithMinMaxVarsPerChannel (<function _FakeQuantWithMinMaxVarsPerChannelGradient at 0x1126ba950>) in gradient.
...
tensorflow: Level 1: Registering queue_runners ((<class 'tensorflow.core.protobuf.queue_runner_pb2.QueueRunnerDef'>, <function QueueRunner.to_proto at 0x1130687b8>, <function QueueRunner.from_proto at 0x113068840>)) in proto functions.
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
...

TensorFlow的详细调试输出在某些情况下可能有用,但对我的情况可能不适用,或者至少对这个特定文件中的测试没有帮助。

我怎么能让他们停用呢?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-04-27 14:14:08

我现在就这么做:

代码语言:javascript
复制
import logging
logging.getLogger('tensorflow').disabled = True
票数 15
EN

Stack Overflow用户

发布于 2017-04-11 06:26:42

你可以试试nosetests tests/test_TFUtil.py --nologcapture

请你把测试文件中的代码贴出来好吗?谢谢。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43337601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档