美文网首页PythonML
The TensorFlow library wasn'

The TensorFlow library wasn'

作者: 谢小帅 | 来源:发表于2017-05-04 23:31 被阅读773次

    MBP 安装好 tensorflow 环境后,程序运行正常,但是出现以下 warnings

    2017-05-04 23:21:11.521746: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
    2017-05-04 23:21:11.521765: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
    2017-05-04 23:21:11.521770: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
    2017-05-04 23:21:11.521774: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
    2017-05-04 23:21:11.521778: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
    

    关掉这些 warnings,需要添加

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

    TF_CPP_MIN_LOG_LEVEL is a TensorFlow environment variable responsible for the logs

    • silence INFO logs set it to 1
    • filter out WARNING set it to 2 (过滤掉程序中的警告)
    • silence ERROR logs (not recommended) set it to 3

    Adriano Carmezim 的解释

    相关文章

      网友评论

        本文标题:The TensorFlow library wasn'

        本文链接:https://www.haomeiwen.com/subject/yyxjtxtx.html