【问题标题】:Warnings on code run that I want to delete我要删除的代码运行警告
【发布时间】:2019-07-11 02:36:22
【问题描述】:

我使用的代码向我显示了很多无用的警告,例如 change np.arrow for tf.arrowthis version will be fixed in next versions... 该警告对我没有帮助,因为我现在真的不需要它并且想知道如何抑制或删除它。

我尝试了warning_ignore...和另一个带有warningfilter的代码,但这些都不起作用,警告仍然可见。

Using TensorFlow backend. WARNING: Logging before flag parsing goes to stderr. W0709 10:34:02.424996 12116 deprecation_wrapper.py:119] From C:\Users\ROBERTO VILCHEZ\AppData\Roaming\Python\Python36\site- packages\keras\backend\tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0709 10:34:02.484447 12116 deprecation_wrapper.py:119] From C:\Users\ROBERTO VILCHEZ\AppData\Roaming\Python\Python36\site- packages\keras\backend\tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0709 10:34:02.499438 12116 deprecation_wrapper.py:119] From C:\Users\ROBERTO VILCHEZ\AppData\Roaming\Python\Python36\site- packages\keras\backend\tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0709 10:34:02.514367 12116 deprecation_wrapper.py:119] From C:\Users\ROBERTO VILCHEZ\AppData\Roaming\Python\Python36\site- packages\keras\backend\tensorflow_backend.py:245: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

这只是许多具有相同形式的警告中的一部分,我只想将其删除。我尝试将 tf.... 替换为 tf... 但我的代码不起作用,因此我只想删除这些警告。

【问题讨论】:

    标签: python tensorflow keras warnings


    【解决方案1】:

    尝试设置日志级别

    import os
    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' 
    

    【讨论】:

      猜你喜欢
      • 2021-12-09
      • 1970-01-01
      • 2017-11-02
      • 1970-01-01
      • 2021-08-18
      • 1970-01-01
      • 2021-01-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多