The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.

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 的解释

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容