相关疑难解决方法(0)

如何抑制详细的Tensorflow日志记录?

我正在使用nosetests对我的Tensorflow代码进行单元测试,但它会产生如此冗长的输出,这使得它无用.

以下测试

import unittest
import tensorflow as tf

class MyTest(unittest.TestCase):

    def test_creation(self):
        self.assertEquals(True, False)
Run Code Online (Sandbox Code Playgroud)

运行时nosetests会产生大量无用的日志记录:

FAIL: test_creation (tests.test_tf.MyTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/cebrian/GIT/thesis-nilm/code/deepmodels/tests/test_tf.py", line 10, in test_creation
    self.assertEquals(True, False)
AssertionError: True != False
-------------------- >> begin captured logging << --------------------
tensorflow: Level 1: Registering Const (<function _ConstantShape at 0x7f4379131c80>) in shape functions.
tensorflow: Level 1: Registering Assert (<function no_outputs at 0x7f43791319b0>) in shape functions.
tensorflow: Level 1: Registering Print (<function _PrintGrad at 0x7f4378effd70>) in gradient. …
Run Code Online (Sandbox Code Playgroud)

nose deep-learning tensorflow

16
推荐指数
3
解决办法
2万
查看次数

尝试运行TensorFlow时CUDNN_STATUS_NOT_INITIALIZED

我已经在Ubuntu 16.04上使用Cuda 9.0和CuDNN 7.0.5以及vanilla Python 2.7安装了TensorFlow 1.7,虽然他们的CUDA和CuDNN样本运行良好,而TensorFlow看到了GPU(因此运行了一些TensorFlow示例),那些使用CuDNN (像大多数CNN的例子一样)没有.他们失败了这些信息性消息:

2018-04-10 16:14:17.013026: I tensorflow/stream_executor/plugin_registry.cc:243] Selecting default DNN plugin, cuDNN
25428 2018-04-10 16:14:17.013100: E tensorflow/stream_executor/cuda/cuda_dnn.cc:403] could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
25429 2018-04-10 16:14:17.013119: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:369] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module  384.130  Wed Mar 21 03:37:26 PDT 2018
25430 GCC version:  gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
25431 """
25432 2018-04-10 16:14:17.013131: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:112] version string "384.130" made value 384.130.0
25433 2018-04-10 16:14:17.013135: E tensorflow/stream_executor/cuda/cuda_dnn.cc:411] possibly insufficient …
Run Code Online (Sandbox Code Playgroud)

python gpu tensorflow cudnn

5
推荐指数
1
解决办法
5460
查看次数

标签 统计

tensorflow ×2

cudnn ×1

deep-learning ×1

gpu ×1

nose ×1

python ×1