Nosetests with tensorflow: a lot of debug output, how to disable

When I use nosetests with some test scripts with TensorFlow, I get a lot of debug output from TensorFlow:

 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 << --------------------- ---------------------------------------------------------------------- ... 

This detailed output from TensorFlow may be useful in some cases, but most likely not for my cases, or at least definitely not for the tests in this particular file.

How to disable them?

+3
source share
2 answers

I am doing it now:

 import logging logging.getLogger('tensorflow').disabled = True 
+7
source

You can try with nosetests tests/test_TFUtil.py --nologcapture .

PS could you send some code from the test file? Thanks.

+3
source

Source: https://habr.com/ru/post/1273702/


All Articles